Java 使用Twitter4j,我如何使用状态/样本和过滤查询进行过滤?

Java 使用Twitter4j,我如何使用状态/样本和过滤查询进行过滤?,java,twitter,twitter4j,Java,Twitter,Twitter4j,如何首先从“获取状态/示例”中获取所有示例推文,然后通过一个词进行过滤 我也试过用链子拴住,但似乎不起作用: e、 g.twitterStream.sample.filter(新过滤器查询(“Microsoft”) 谢谢检查此项:stackoverflow.com/questions/16665683/filter-twitter4j-stream TwitterStreamFactory tf = new TwitterStreamFactory(cb.build());

如何首先从“获取状态/示例”中获取所有示例推文,然后通过一个词进行过滤

我也试过用链子拴住,但似乎不起作用: e、 g.twitterStream.sample.filter(新过滤器查询(“Microsoft”)


谢谢

检查此项:stackoverflow.com/questions/16665683/filter-twitter4j-stream

        TwitterStreamFactory tf = new TwitterStreamFactory(cb.build());
        TwitterStream twitterStream = tf.getInstance();
        twitterStream.addListener(listener);
        twitterStream.sample():
        twitterStream.filter(new FilterQuery("Microsoft"));