5
votes

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

1
What tweets do you want to receive? If a tweet doesn't have location information, it's pretty obvious that it can't be searched by location, isn't it?JJJ
Yes, I was thinking if twitter gives the locations based on the IP addresses, I might be wrong or even absurd but just thinking.Rkz

1 Answers

4
votes

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.