mirror of
https://github.com/sigmasternchen/MinervaBot
synced 2025-03-15 07:59:00 +00:00
connect to api
This commit is contained in:
parent
4722538de9
commit
e168930685
1 changed files with 4 additions and 2 deletions
6
main.py
6
main.py
|
@ -12,19 +12,21 @@ def log(text):
|
|||
logfile.write(datetime.datetime.now().isoformat() + ": " + text))
|
||||
|
||||
def connect():
|
||||
api = twitter.Api(
|
||||
return twitter.Api(
|
||||
consume_key = CONSUMER_KEY,
|
||||
consumer_secret = CONSUMER_SECRET,
|
||||
access_token_key = ACCESS_TOKEN_KEY,
|
||||
access_token_secret = ACCESS_TOKEN_SECRET
|
||||
)
|
||||
return api
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
log("starting minerva")
|
||||
|
||||
api = connect()
|
||||
log("connected to Twitter API")
|
||||
|
||||
lastChange = 0
|
||||
|
||||
lastChange = api.getDirectMessages(since_id = lastChange)[0].GetId()
|
||||
|
|
Loading…
Reference in a new issue