检索给定主题标签最多转发的推文
我想检索给定主题标签的推文,并将它们从转发最多的推文到转发较少的推文进行排序。
我发现的最接近的是使用搜索调用并使用类型标签: 例如: http://search.twitter.com/search.json?q =TheHashTagHere&result_type=popular
但是,我不确定“流行”选项如何工作。
例如,如果它找到带有该主题标签的 100 条推文,我相信它应该显示 X 条转发次数最多的推文,如果这些推文都没有被转发,那么它应该随机显示其中的 X 条(或者以其他方式排序,例如最近的) )。
不幸的是,如果遵循某种未知的规则来识别什么是流行的、什么是不流行的,甚至具有数千条推文的主题标签也可能只返回一两个结果。
我希望我说清楚了。预先感谢:)
PS:我将使用 PHP,但我认为这不应该影响这个问题?
I'd like to retrieve the tweets for given a hashtag and sort them from the most retweeted to the less retweeted.
The closest thing I've found is using the search call and use the type tag:
E.g.: http://search.twitter.com/search.json?q=TheHashTagHere&result_type=popular
However, I'm not sure on how "popular" option works.
For instance, if it finds 100 tweets with that hashtag I believe it should show the X most retweeted tweets, and if none of those tweets have been retweeted then it should show X of them randomly (or sorted in some other way like the most recent).
Unfortunately, if follows some kind of unknown rule to identify what's popular and what not and even hashtags with thousands of tweets might return only one or two results.
I hope I made myself clear. Thanks in advance :)
PS: I'll use PHP but I think that shouldn't affect the question?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
来源(重点是我的)
只需使用
result_type=popular
并检查recent_retweets
节点以了解如何它很受欢迎。result_type=popular
将成为即将发布的版本中的默认设置,因此如果省略此参数,请小心。热门推文的结果不按时间顺序排列。 *
如果您希望始终显示结果,请使用
result_type =mixed
:它们的“元数据”部分中的result_type
值为“recent”,热门结果将具有“popular”。关于 result_types 的小参考:如果搜索查询有任何热门结果,这些结果将返回到顶部,即使它们比其他结果更旧。 *
*[Twitter API 公告]
Source (Emphasis are mine)
Just call with
result_type=popular
and check therecent_retweets
node to see how popular it is.result_type=popular
will become the default in an upcome release so beware if you omit this parameter.Results with popular tweets aren't ordered chronologically. *
If you would like to always have results to show, use
result_type=mixed
: they will have theresult_type
in the "metadata" section with a value of "recent", and popular results will have "popular". A small reference about result_types:If a search query has any popular results, those will be returned at the top, even if they are older than the other results. *
*[Twitter API Announcements]
这不是一种编程方法,而是在具有 chrome 扩展的浏览器中工作(HackyBird) :
PS 它还会对您或任何其他用户的时间线进行排序。
This isn't a programmatic method but rather works in the browser with a chrome extension (HackyBird) :
P.S. It'll also sort your or any other user's timeline.