1 # What are people tweeting about in Times Square today?
3 # Note: to answer this, I used this website to find a good box:
4 # http://boundingbox.klokantech.com/
8 from twitter_authentication import CONSUMER_KEY, CONSUMER_SECRET, ACCESS_TOKEN, ACCESS_TOKEN_SECRET
10 auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
11 auth.set_access_token(ACCESS_TOKEN, ACCESS_TOKEN_SECRET)
13 api = tweepy.API(auth)
15 class StreamListener(tweepy.StreamListener):
16 def on_status(self, tweet):
17 print(tweet.author.screen_name + "\t" + tweet.text)
19 def on_error(self, status_code):
20 print('Error: ' + repr(status_code))
24 streamer = tweepy.Stream(auth=auth, listener=l)
26 # This should grab tweets in Times Square
27 streamer.filter(locations=[-73.9864799803,40.7575460197,-73.9837820197,40.7602439803])