Twitter API 是否允许按用户名和主题标签进行过滤?

发布于 2024-09-15 07:02:48 字数 113 浏览 2 评论 0原文

我可以获得特定用户使用特定主题标签的所有推文吗?

我可以只获取过去 100 条推文,然后在我这边进行过滤,但如果 Twitter 可以在他们这边进行过滤,那就方便多了。

这可能吗?

Can I get all the tweets of a particular user, in which a particular hashtag is used?

I could just get the past 100 tweets then filter them on my end, but it would be much more convenient if Twitter could do the filtering on their end.

Is this possible?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(3

爱要勇敢去追 2024-09-22 07:02:50

Twitter 的高级搜索可让您构建所需的查询。不幸的是,目前搜索结果似乎只针对过去 24 小时左右发布的推文;可能只是暂时的限制,不确定。

无论如何,您的请求 URL 可能如下所示(请注意 JSON 和 Atom 类型):

http://search.twitter.com/search?q=%23HASHTAG+from:USERNAME
http://search.twitter.com/search.json?q=%23HASHTAG+from:USERNAME
http://search.twitter.com/search.atom?q=%23HASHTAG+from:USERNAME

但由于当前的时间范围限制,它不太实用。

Twitter's Advanced Search lets you construct the query you desire. Unfortunately, search results only seem to be for tweets posted within the past 24 hours or so right now; might just be a temporary limitation, not sure.

In any case, your request URL might look something like this (note the JSON and Atom types):

http://search.twitter.com/search?q=%23HASHTAG+from:USERNAME
http://search.twitter.com/search.json?q=%23HASHTAG+from:USERNAME
http://search.twitter.com/search.atom?q=%23HASHTAG+from:USERNAME

But with the current timeframe limitation, it's not very practical.

长途伴 2024-09-22 07:02:50

我正在阅读 Twitter 文档,他们说现在它只包含 6-9 天的推文。链接 https://dev.twitter.com/docs/using-search

I am reading the twitter documentation and they say right now it will include only 6-9 days of tweets. Link https://dev.twitter.com/docs/using-search

栀子花开つ 2024-09-22 07:02:50

要针对 Twitter API v1.1(需要 OAuth)进行此搜索,您需要向结构如下的 URL 发出 GET 请求:

https://api.twitter.com/1.1/search/tweets.json?q=from:whitehouse+#sotu

请参阅他们的 Search API 的“如何构建查询”部分。不过,您在过去 7 天内只能发布推文。

To do this search against v1.1 of Twitter's API (which requires OAuth), you'd issue a GET request to the a URL structured like:

https://api.twitter.com/1.1/search/tweets.json?q=from:whitehouse+#sotu

See their Search API's "How to build a query" section. You'll be constrained to tweets over the last 7 days, though.

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