made a collection of twitter api solutions
[twitter-api-cdsw-solutions] / solution-geo-2.py
similarity index 67%
rename from twitter-stream1.py
rename to solution-geo-2.py
index e94422dd0f8dc43b3c99258755aa429cea3a17a6..c7830ff9ff7e9864ff29e8828f68a5058f334505 100644 (file)
@@ -1,3 +1,8 @@
+# What are people tweeting about in Times Square today?
+
+# Note: to answer this, I used this website to find a good box:
+# http://boundingbox.klokantech.com/
+
 import encoding_fix
 import tweepy
 from twitter_authentication import CONSUMER_KEY, CONSUMER_SECRET, ACCESS_TOKEN, ACCESS_TOKEN_SECRET
@@ -18,4 +23,6 @@ class StreamListener(tweepy.StreamListener):
 l = StreamListener()
 streamer = tweepy.Stream(auth=auth, listener=l)
 
-streamer.sample()
+# This should grab tweets in Times Square
+streamer.filter(locations=[-73.9864799803,40.7575460197,-73.9837820197,40.7602439803])
+

Benjamin Mako Hill || Want to submit a patch?