ovipositor/main.py

25 lines
695 B
Python
Raw Normal View History

2017-08-22 00:09:54 +02:00
#!/usr/bin/env python3
2016-09-20 21:28:39 +02:00
# -*- coding: utf-8 -*-
import tweepy
from time import sleep
from retweetingstreamlistener import RetweetingStreamListener
from tokens import CONSUMER_KEY, CONSUMER_SECRET, ACCESS_TOKEN, ACCESS_TOKEN_SECRET
def setup_api():
auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
auth.set_access_token(ACCESS_TOKEN, ACCESS_TOKEN_SECRET)
return tweepy.API(auth)
if __name__ == '__main__':
api = setup_api()
while True:
stream = tweepy.Stream(auth = api.auth, listener=RetweetingStreamListener(api))
2017-09-05 22:08:19 +02:00
stream.filter(track=['#tschunkcyberparty', '#tcp2017', '#zaunei2017', '@zaunei2017'])
2017-08-22 00:09:54 +02:00
print("[Error] Something went wrong reconnecting")
2016-09-20 21:28:39 +02:00
sleep(10.0)