Examples of StatusListener


Examples of twitter4j.StatusListener

    }

    public TwitterStream streamingTwitter(Collection<String> track, final Queue<JTweet> queue) throws TwitterException {
        String[] trackArray = track.toArray(new String[track.size()]);
        TwitterStream stream = new TwitterStreamFactory().getInstance(twitter.getAuthorization());
        stream.addListener(new StatusListener() {

            @Override
            public void onStatus(Status status) {
                // ugly twitter ...
                if (Helper.isEmpty(status.getUser().getScreenName()))
View Full Code Here

Examples of twitter4j.StatusListener

        twitterProperties.load(new FileInputStream(twitter4jPropsFile));

        cb.setDebugEnabled(Boolean.valueOf(twitterProperties.getProperty("debug")))
                .setUser(twitterProperties.getProperty("user")).setPassword(twitterProperties.getProperty("password"));
        TwitterStream twitterStream = new TwitterStreamFactory(cb.build()).getInstance();
        StatusListener statusListener = new StatusListener() {

            @Override
            public void onException(Exception ex) {
                logger.error("error", ex);
            }
View Full Code Here

Examples of twitter4j.StatusListener

        final StatefulKnowledgeSession ksession = this.createKSession();
        final WorkingMemoryEntryPoint workingMemoryEntryPoint = ksession.getWorkingMemoryEntryPoint("tweets");
        // The factory instance is re-useable and thread safe.
       
       StatusListener listener = new StatusListener(){
                public void onStatus(Status status) {
                    workingMemoryEntryPoint.insert(status);
                    ksession.fireAllRules();
                    System.out.println(status.getUser().getName() + " : " + status.getText());
                }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.