from twitter.MyStreamListener import MyStreamListener
import tweepy
from threading import Thread


class TwitterWorker(Thread):
        def __init__(self):
                Thread.__init__(self)
                CONSUMER_KEY = 'IwZZeJHjLXq55ewwQwD0SogHU'
                CONSUMER_SECRET = '<KEY>'
                ACCESS_TOKEN = '857838183224139776-1HrWNTQk8pywtozedEAou6tr7CkB4Uu'
                ACCESS_TOKEN_SECRET = '<KEY>'
                self.auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
                self.auth.set_access_token(ACCESS_TOKEN, ACCESS_TOKEN_SECRET)
                self.api = tweepy.API(self.auth)

        def run(self):
                streamListener = MyStreamListener()
                self.stream = tweepy.Stream(auth=self.api.auth, listener=streamListener)
                self.stream.filter(track=['#HACKPSUHELPLINE'])


if __name__ == '__main__':
        print("Starting Stream..")
        tw = TwitterWorker()
        tw.streaming()

from twitter.MyStreamListener import MyStreamListener
import tweepy
from threading import Thread


class TwitterWorker(Thread):
        def __init__(self):
                Thread.__init__(self)
                CONSUMER_KEY = 'IwZZeJHjLXq55ewwQwD0SogHU'
                CONSUMER_SECRET = '<KEY>'
                ACCESS_TOKEN = '857838183224139776-1HrWNTQk8pywtozedEAou6tr7CkB4Uu'
                ACCESS_TOKEN_SECRET = '<KEY>'
                self.auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
                self.auth.set_access_token(ACCESS_TOKEN, ACCESS_TOKEN_SECRET)
                self.api = tweepy.API(self.auth)

        def run(self):
                streamListener = MyStreamListener()
                self.stream = tweepy.Stream(auth=self.api.auth, listener=streamListener)
                self.stream.filter(track=['#HACKPSUHELPLINE'])


if __name__ == '__main__':
        print("Starting Stream..")
        tw = TwitterWorker()
        tw.streaming()
