带过滤的流式API

时间:2014-03-10 10:28:49

标签: twitter

我正在尝试编写一个只能从twitter流式传输阿拉伯语推文的代码。 我尝试使用以下代码:

FilterQuery q = new FilterQuery();

String[] langs = new String[1];

langs[0]="ar";

q.language(langs);

twitterStream.filter(q);

不幸的是它给了我以下错误:( :(

406:Returned by the Search API when an invalid format is specified in the request.
Returned by the Streaming API when one or more of the parameters are not suitable for the resource. The track parameter, for example, would throw this error if:
The track keyword is too long or too short.
The bounding box specified is invalid.
No predicates defined for filtered resource, for example, neither track nor follow parameter defined.
Follow userid cannot be read.
No filter parameters found. Expect at least one parameter: follow track locations

[Mon Mar 10 13:15:25 GMT+03:00 2014]Parameter not accepted with the role. 406:Returned by the Search API when an invalid format is specified in the request.
Returned by the Streaming API when one or more of the parameters are not suitable for the resource. The track parameter, for example, would throw this error if:
The track keyword is too long or too short.
The bounding box specified is invalid.
No predicates defined for filtered resource, for example, neither track nor follow parameter defined.
Follow userid cannot be read.

No filter parameters found. Expect at least one parameter: follow track locations

但是,如果我添加跟踪阿拉伯语言的关键字,它可以工作。但我不想用该语言跟踪关键字。

关于我为什么会遇到这个错误的任何想法,如果你有替代方法我可以使用它?

Thnx提前

0 个答案:

没有答案