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

有帮助吗?

解决方案

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.
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top