Timestamps
This commit is contained in:
parent
158881ab9d
commit
2351f608ae
1 changed files with 4 additions and 3 deletions
|
|
@ -1,10 +1,11 @@
|
||||||
import os
|
import os
|
||||||
import redis
|
import redis
|
||||||
|
import time
|
||||||
import tweepy
|
import tweepy
|
||||||
|
|
||||||
class Connector():
|
class Connector():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
print("Loading Redis connector...")
|
print(time.time() + ": " + "Loading Redis connector...")
|
||||||
# TODO: Add token
|
# TODO: Add token
|
||||||
self.dbconn = redis.Redis(
|
self.dbconn = redis.Redis(
|
||||||
host=os.getenv("REDIS_HOST"),
|
host=os.getenv("REDIS_HOST"),
|
||||||
|
|
@ -13,11 +14,11 @@ class Connector():
|
||||||
)
|
)
|
||||||
|
|
||||||
self.api = Connector.init_api(self.dbconn)
|
self.api = Connector.init_api(self.dbconn)
|
||||||
print("Success loading connectors!")
|
print(time.time() + ": " + "Success loading connectors!")
|
||||||
|
|
||||||
def init_api(dbconn):
|
def init_api(dbconn):
|
||||||
# Syslog report
|
# Syslog report
|
||||||
print("Loading Twitter API connector...")
|
print(time.time() + ": " + "Loading Twitter API connector...")
|
||||||
|
|
||||||
return tweepy.Client(
|
return tweepy.Client(
|
||||||
bearer_token=dbconn.hget("api", "bearer").decode("utf-8"),
|
bearer_token=dbconn.hget("api", "bearer").decode("utf-8"),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue