Package net.fortytwo.twitlogic.services.twitter.twitter4j

Examples of net.fortytwo.twitlogic.services.twitter.twitter4j.Twitter4jClient


        store.initialize();

        try {
            // Create a client for communication with Twitter.
            //TwitterClient client = new Twitter4jClient();
            TwitterClient client = new Twitter4jClient();

            Handler<Tweet> annotator
                    = createAnnotator(store, client);

            Set<User> users = TwitLogic.findFollowList(client);
            Set<String> terms = TwitLogic.findTrackTerms();
            double [][]locations = TwitLogic.findGeoBoxes();

//            GregorianCalendar cal = new GregorianCalendar(2010, GregorianCalendar.MAY, 1);
//            //gatherHistoricalTweets(store, client, users, cal.getTime());

            TweetReceivedLogger rLogger = new TweetReceivedLogger(client.getStatistics(), annotator);
            TweetDeleter d = new TweetDeleter(store);

            ExampleTweetHandler h = new ExampleTweetHandler();
//            client.processFilterStream(users, terms, rLogger, d, 0);
            client.processFilterStream(users, terms, locations, h, d, 0);
            //client.processSampleStream(rLogger, d);
        } finally {
            store.shutDown();
        }
    }
View Full Code Here


        boolean exitedNormally = false;

        try {
            // Create a client for communication with Twitter.
            TwitterClient client = new Twitter4jClient();
            //TwitterClient client = new CustomTwitterClient();

            // Launch linked data server.
            store.startServer(client);

            Handler<Tweet> annotator
                    = createAnnotator(store, client);

            // Create an agent to listen for commands.
            // Also take the opportunity to memoize users we're following.
            /*
            TwitLogicAgent agent = new TwitLogicAgent(client);
            UserRegistry userRegistry = new UserRegistry(client);
            Handler<Tweet, TweetHandlerException> realtimeStatusHandler
                    = userRegistry.createUserRegistryFilter(
                    new CommandListener(agent, annotator));
            */

            Set<User> users = TwitLogic.findFollowList(client);
            Set<String> terms = TwitLogic.findTrackTerms();

            GregorianCalendar cal = new GregorianCalendar(2010, GregorianCalendar.MAY, 1);
            //gatherHistoricalTweets(store, client, users, cal.getTime());

            TweetReceivedLogger rLogger = new TweetReceivedLogger(client.getStatistics(), annotator);
            TweetDeleter d = new TweetDeleter(store);
            client.processFilterStream(users, terms, null, rLogger, d, 0);

            exitedNormally = true;
        } finally {
            if (!exitedNormally) {
                LOGGER.warning("exited abnormally");
View Full Code Here

        // Create a persistent store.
        TweetStore store = new TweetStore();
        store.initialize();

        try {
            TwitterClient client = new Twitter4jClient();

            //store.dump(System.out);
            //store.dumpToFile(new File("/tmp/twitlogic-tmp-dump.trig"), RDFFormat.TRIG);

            // Launch linked data server.
View Full Code Here

            // Create a persistent store.
            TweetStore store = new TweetStore();
            store.initialize();

            try {
                TwitterClient client = new Twitter4jClient();

                // Launch linked data server.
                store.startServer(client);

                Object mutex = "";
View Full Code Here

TOP

Related Classes of net.fortytwo.twitlogic.services.twitter.twitter4j.Twitter4jClient

Copyright © 2018 www.massapicom. 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.