Examples of TwitterClient


Examples of com.adobe.acs.commons.twitter.TwitterClient

    private TwitterFactory factory;

    @SuppressWarnings("unchecked")
    @Override
    public <AdapterType> AdapterType getAdapter(Object adaptable, Class<AdapterType> type) {
        TwitterClient client = null;
        if (adaptable instanceof Page) {
            client = createTwitterClient((Page) adaptable);
        } else if (adaptable instanceof com.day.cq.wcm.webservicesupport.Configuration) {
            client = createTwitterClient((com.day.cq.wcm.webservicesupport.Configuration) adaptable);
        }

        if (client != null) {
            if (type == TwitterClient.class) {
                return (AdapterType) client;
            } else if (type == Twitter.class) {
                return (AdapterType) client.getTwitter();
            }
        }

        return null;
    }
View Full Code Here

Examples of com.streamreduce.util.TwitterClient

                    connection.getId(), connection.getUrl(), e.getMessage()));
        }
    }

    private void pullTwitterActivity(Connection connection) {
        TwitterClient client = (TwitterClient)getClient(connection);

        try {
            JSONObject profile = client.getLoggedInProfile();

            if (profile == null) {
                logger.error("User's profile for Twitter connection %s came back null.", connection.getId());
                return;
            }
View Full Code Here

Examples of com.streamreduce.util.TwitterClient

     * {@inheritDoc}
     */
    @Override
    public String getIdentityFromProvider(Connection c) {
        try {
            TwitterClient twitterClient = getClient(c);
            JSONObject jsonObject = twitterClient.getLoggedInProfile();
            return jsonObject.getString("screen_name");
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
View Full Code Here

Examples of com.streamreduce.util.TwitterClient

    /**
     {@inheritDoc}
     */
    @Override
    public TwitterClient getClient(Connection connection) {
        return new TwitterClient(connection,getOAuthService());
    }
View Full Code Here

Examples of net.fortytwo.twitlogic.services.twitter.TwitterClient

        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

Examples of net.fortytwo.twitlogic.services.twitter.TwitterClient

        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

Examples of net.fortytwo.twitlogic.services.twitter.TwitterClient

        // 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

Examples of net.fortytwo.twitlogic.services.twitter.TwitterClient

            // 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

Examples of net.fortytwo.twitlogic.services.twitter.TwitterClient

            long now = System.currentTimeMillis();
            if (-1 == lastUpdate || (expireTime > 0 && now - lastUpdate > expireTime)) {
                LOGGER.info((0 == lastUpdate ? "setting" : "updating") + " followees of " + personURI);

                // fetch followees
                TwitterClient client = store.getTwitterClient();
                List<User> followees = client.getFollowees(user, followeeLimit);

                URI foafKnows = vf.createURI(FOAF.KNOWS);

                // persist self and foaf:knows edges
                sc.removeStatements(personURI, foafKnows, null);
View Full Code Here

Examples of org.eclipse.twipse.core.TwitterClient

  };

 
  TwipseContainer() throws IDCreateException {
    client = new TwitterClient();
    guid = IDFactory.getDefault().createGUID();
    namespace = IDFactory.getDefault().getNamespaceByName(
        TwipsePlugin.NAMESPACE_IDENTIFIER);
    user = new Account();
    //chatSessions = new Hashtable();
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.