Tweedy blank search

I searched the net for an answer, but I did not find anything that, in my opinion, could be a simple question:

Is there a way to get "empty" requests from tweepy?

For example, get all tweets from a location.

I can not send a request without a request field:

query= tweepy.api.search(q="", rpp=1000) 

It returns:

tweepy.error.TweepError: you must enter a query.

What I'm looking for is to get this request, for example:

http://search.twitter.com/search.atom?geocode=38.376,-0.5,8km

Get all tweets from ...

+4
source share
1 answer

q parameter is optional, geocode too (see docs ).

This works for me:

 import tweepy auth = tweepy.OAuthHandler(<consumer_key>, <consumer_secret>) auth.set_access_token(<key>, <secret>) api = tweepy.API(auth) results = tweepy.api.search(geocode="38.376,-0.5,8km", rpp=1000) for result in results: print result.text print result.location if hasattr(result, 'location') else "Undefined location" 

Hope this helps.

+7
source

All Articles