检索给定主题标签最多转发的推文

发布于 2024-11-08 20:48:27 字数 534 浏览 0 评论 0原文

我想检索给定主题标签的推文,并将它们从转发最多的推文到转发较少的推文进行排序。

我发现的最接近的是使用搜索调用并使用类型标签: 例如: 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

睫毛溺水了 2024-11-15 20:48:27

结果有时会包含
result_type 字段写入元数据
值为“最近”或
“受欢迎的”。热门结果得出
通过 Twitter 计算的算法
默认情况下最多会出现 3 个
搜索 API 的混合模式
下运作。热门结果
在元数据中包含另一个节点
称为recent_retweets。这个领域
表示推文转发次数
曾经有过。

来源(重点是我的)

只需使用result_type=popular 并检查 recent_retweets 节点以了解如何它很受欢迎。 result_type=popular 将成为即将发布的版本中的默认设置,因此如果省略此参数,请小心。

热门推文的结果不按时间顺序排列。 *

如果您希望始终显示结果,请使用 result_type =mixed:它们的“元数据”部分中的 result_type 值为“recent”,热门结果将具有“popular”。关于 result_types 的小参考:

混合:在响应中包含热门结果和实时结果。

最近:仅返回响应中的最新结果

流行:仅返回响应中最受欢迎的结果。

如果搜索查询有任何热门结果,这些结果将返回到顶部,即使它们比其他结果更旧。 *

*[Twitter API 公告]

Results will sometimes contain a
result_type field into the metadata
with a value of either "recent" or
"popular". Popular results are derived
by an algorithm that Twitter computes,
and up to 3 will appear in the default
mixed mode that the Search API
operates under. Popular results
include another node in the metadata
called recent_retweets. This field
indicates how many retweets the Tweet
has had.

Source (Emphasis are mine)

Just call with result_type=popular and check the recent_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 the result_type in the "metadata" section with a value of "recent", and popular results will have "popular". A small reference about result_types:

mixed: Include both popular and real time results in the response.

recent: return only the most recent results in the response

popular: return only the most popular results in the response.

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]

街道布景 2024-11-15 20:48:27

这不是一种编程方法,而是在具有 chrome 扩展的浏览器中工作(HackyBird) :

  • 安装扩展
  • 搜索短语,例如#Social (twitter. com/search?q=%23Social)
  • 单击扩展程序对其进行排序(您可以在扩展程序选项中调整用于排序的转发/喜欢的比例)。

PS 它还会对您或任何其他用户的时间线进行排序。

This isn't a programmatic method but rather works in the browser with a chrome extension (HackyBird) :

  • Install the extension
  • Search for a phrase e.g. #Social (twitter.com/search?q=%23Social)
  • Click the extension to sort it (you can adjust the ratio of retweets/likes used for sorting in extension options).

P.S. It'll also sort your or any other user's timeline.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文