开发者

How would one utilise Twitter's Streaming API to retrieve Tweets from a specified country?

My goal is to retrieve all Tweets, or as significant a proportion as I can, that originate from certain small countries such as Ireland,New Zealand,Lithuania etc.

Twitter's Search API allows the searching of statuses in a radius around a given lat/long. Twitter decides which results to return by the geotag data included in a user's profile, or b开发者_开发百科y reverse-geocoding the user's Hometown location in their profile.

The public status stream in the Streaming API can be filtered by geobox, but Twitter does not perform reverse-geocoding when returning these results. Research so far has indicated that not very many people at all in these countries use geo-tagging.

Obviously, if I had access to the firehose stream, then using the Streaming API would be the way to go, as I could perform the reverse-geocoding myself. At the default access level, however, the random sample stream does not provide enough relevant users to me.

What, then, if any benefit could I get from using the Streaming API? Should I simply stick to the Search API, as I am unlikely to get any unique data from the Streaming API?


You can pass locations parameter to specify the area of geotagged tweets. http://dev.twitter.com/pages/streaming_api_methods#locations

With Twitter4J, use FilterQuery#locations(). http://twitter4j.org/en/javadoc/twitter4j/FilterQuery.html#locations(double[][])

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜