Search in sources :

Example 1 with StatusAdapter

use of twitter4j.StatusAdapter in project twitter4j by yusuke.

the class TwitterStreamLambda method oldTraditionalDullBoringImplementation.

public static void oldTraditionalDullBoringImplementation(String... dummy) {
    // Twitter4J 4.0.3 or earlier
    TwitterStream stream = TwitterStreamFactory.getSingleton();
    stream.addListener(new StatusAdapter() {

        @Override
        public void onStatus(Status status) {
            String.format("@%s %s", status.getUser().getScreenName(), status.getText());
        }

        @Override
        public void onException(Exception ex) {
            ex.printStackTrace();
        }
    });
    stream.filter(new FilterQuery(new String[] { "twitter4j", "#twitter4j" }));
}
Also used : Status(twitter4j.Status) StatusAdapter(twitter4j.StatusAdapter) TwitterStream(twitter4j.TwitterStream) FilterQuery(twitter4j.FilterQuery)

Aggregations

FilterQuery (twitter4j.FilterQuery)1 Status (twitter4j.Status)1 StatusAdapter (twitter4j.StatusAdapter)1 TwitterStream (twitter4j.TwitterStream)1