3 from twitter_authentication import CONSUMER_KEY, CONSUMER_SECRET, ACCESS_TOKEN, ACCESS_TOKEN_SECRET
5 auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
6 auth.set_access_token(ACCESS_TOKEN, ACCESS_TOKEN_SECRET)
10 class StreamListener(tweepy.StreamListener):
11 def on_status(self, tweet):
12 print(tweet.author.screen_name + "\t" + tweet.text)
14 def on_error(self, status_code):
15 print( 'Error: ' + repr(status_code))
19 streamer = tweepy.Stream(auth=auth, listener=l)
21 keywords = ['python', 'perl']
22 streamer.filter(track = keywords)