在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干杯
发布于 2013-02-06 20:37:30
您必须传递在twitter搜索中使用的相同do,您的查询将如下所示:
new Query("lang:en")发布于 2018-08-21 17:20:33
使用twitter4j,
Query query = new Query(); query.setLang("en"); query.setQuery(searchQuery);
https://stackoverflow.com/questions/14627437
复制相似问题