我遵循了HBC的快速入门,并设法从 Twitter 流中获取了一些推文,指定了一些跟踪术语,这里是代码:
/** Declare the host you want to connect to, the endpoint, and authentication (basic auth or oauth) */
Hosts hosebirdHosts = new HttpHosts(Constants.STREAM_HOST);
StreamingEndpoint endpoint = new StatusesFilterEndpoint();
// Optional: set up some followings and track terms
List<Long> followings = Lists.newArrayList(1234L, 566788L);
List<String> terms = Lists.newArrayList("twitter", "api");
endpoint.followings(followings);
endpoint.trackTerms(terms);
是否可以在不指定任何跟踪条款的情况下使用Hbc获取 twitter 流?我只是试图删除行“endpoint.trackTerms(terms);” 但这样做是行不通的。
帮我!谢谢!