I previously asked a question about fetching the last 100 mentions for a person via the twitter api. Now I succeeded in that, I noticed that the twitter api by default doesn’t have a ‘location’ tag. I believe that is related to the ‘search.twitter.com’ result
Below you can find the code I use and the twitter search querystring.
Can I add something which will force to show the location ?
Thanks in advance!
tweets = json.loads(urllib2.urlopen('http://search.twitter.com/search.json?q=BarackObama&rpp=5&include_entities=true&result_type=mixed').read())['results'][0:3]
If there are Geo Co-ordinates recorded when the tweet was sent, you will retrieve them in your search contained in the
coordinatesfield. If it is absent, ornulthen it was not recorded.If you want to force it to only give you back tweets that have coordinates stored in them, then you can use the optional
geocodeparameter.