2 from twitter_authentication import CONSUMER_KEY, CONSUMER_SECRET, ACCESS_TOKEN, ACCESS_TOKEN_SECRET
4 auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
5 auth.set_access_token(ACCESS_TOKEN, ACCESS_TOKEN_SECRET)
9 class StreamListener(tweepy.StreamListener):
10 def on_status(self, tweet):
11 print tweet.user.screen_name + "\t" + tweet.text
13 def on_error(self, status_code):
14 print 'Error: ' + repr(status_code)
18 streamer = tweepy.Stream(auth=auth, listener=l)
20 keywords = ['python', 'perl']
21 streamer.filter(track = keywords)