Timestamps

This commit is contained in:
Lucy Joshua 2023-03-22 14:34:34 +02:00 committed by GitHub
parent 158881ab9d
commit 2351f608ae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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"),