Twitter では、lang 演算子を使用して、特定の言語から取得するツイートを検索できます。たとえば、次の検索では、英語のツイートのみが返されます。
https://twitter.com/search?q=lang:en
特にtwitter4jを使用して、twitter APIを使用してこれを達成する方法はありますか? 検索用の言語属性があることは知っていますが、検索を行うには少なくとも 1 つのキーワードが必要です。キーワード クエリを指定せずに特定の言語で検索したいと考えています。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
乾杯