Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

tweepy/twitter get all tweets from a location:

I have the following questions about tweepy python module

1.I am trying to retrieve all tweets for a specific location. I am able to do this by using tweepy python module (streaming API), but I get only those tweets whose geo locations are enabled, which means I would loose rest of the tweeter’s tweet who have not enabled their geo location. Is there a better way to retrieve all the tweets, given a location?

2.I use Stream.Sample method to retrieve all the tweets, Can someone tell me about the parameters used in sample method? I see count, and async as parameters. Now what should we specify here?

3.What does firehose method in tweepy.Stream do?

Any help is much appreciated

like image 364
Rkz Avatar asked Oct 10 '22 12:10

Rkz


1 Answers

If tweepy doesn't have a feature you need, you can always access Twitter directly with an HTTP request. The full Twitter REST API is described here: https://dev.twitter.com/docs/api

The ones that seem relevant to your interest are:

  • GET trends/:woeid which looks up tweets by woeid, a Yahoo Identifier for collecting information about a given place/landmark/etc.
  • GET geo/id/:place_id which only mines geotagged tweets.
  • There is documentation of all the information available for a GET request but the IP address is not among the available fields: https://dev.twitter.com/docs/api/1/get/search .
  • Lastly, Twitter has a location search FAQ that may be of interest.
like image 67
Raymond Hettinger Avatar answered Oct 13 '22 12:10

Raymond Hettinger