Twitter 流 API 是否允许通过 URL 进行过滤?

Does twitter stream API allow filtering by urls?

我正在尝试按网址进行过滤,但未返回任何结果。 从以下文档中可以看出,https://developer.twitter.com/en/docs/tweets/rules-and-filtering/overview/premium-operators 但我认为这是一项高级功能。这是真的?如果是,那么有没有其他方法可以在不使用高级功能的情况下按 url 进行过滤?

标准 Twitter 流 API 为我们提供 'track' 参数。这是一个标准流 API 参数(参见 doc)。它通过短语和 URL 匹配推文。根据文档的常见用例:

a common use case where you may want to track all mentions of a particular domain name (i.e., regardless of subdomain or path), you should use “example com” as the track parameter for “example.com”

这个参数值将匹配...:

example.comwww.example.com foo.example.com foo.example.com/bar I hope my startup isn’t merely another example of a dot com boom!

我通过 Java 的 twitter-hbc 库测试了该选项。它按预期工作!

为避免混淆,请注意:

The text of the Tweet and some entity fields are considered for matches. Specifically, the text attribute of the Tweet, expanded_url and display_url for links and media, text for hashtags, and screen_name for user mentions are checked for matches.