在 Twitter 中,通过使用 lang 运算符,您可以搜索从特定语言检索推文:例如,以下搜索将仅返回英语推文:
https://twitter.com/search?q=lang:en
有没有办法使用 twitter api 来实现这一点,特别是使用 twitter4j。我知道有一个用于搜索的语言属性,但它还需要至少一个关键字才能进行搜索,我想按一种特定语言进行搜索而不给出任何关键字查询。 java 驱动程序中的以下命令返回以下错误:
Query searchQuery = new Query() //
.count(resultsPerPage) //
.since(since)//
.lang("en");
400:The request was invalid. An accompanying error message will explain why. This is the status code will be returned during version 1.0 rate limiting(https://dev.twitter.com/pages/rate-limiting). In API v1.1, a request without authentication is considered invalid and you will get this response.
message - Query parameters are missing
code - 25
干杯
最佳答案
您必须传递与 Twitter 搜索中使用的相同的内容,您的查询将类似于:
new Query("lang:en")
关于java - 按语言搜索推特,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14627437/