Package de.jetwick.tw

Examples of de.jetwick.tw.Credits


//        uSearch.search(jetwickUsers, new SolrQuery().setRows(10000));
        final Set<String> set = new TreeSet<String>();
//        for (SolrUser u : jetwickUsers) {
//            set.add(u.getScreenName());
//        }
        Credits credits = config.getTwitterSearchCredits();
        TwitterSearch tw4j = new TwitterSearch().setConsumer(credits.getConsumerKey(), credits.getConsumerSecret());
        tw4j.initTwitter4JInstance(credits.getToken(), credits.getTokenSecret(), true);
        tw4j.getFollowers(user, new AnyExecutor<JUser>() {

            @Override
            public JUser execute(JUser o) {
//                if (set.contains(o.getScreenName()))
View Full Code Here


        return get(key);
    }

    public Credits getTwitterSearchCredits() {
        String key = "jetslide.twitter4j.main.";
        return new Credits(get(key + "token"), get(key + "tokenSecret"),
                get(key + "consumerKey"), get(key + "consumerSecret"));
    }
View Full Code Here

                get(key + "consumerKey"), get(key + "consumerSecret"));
    }

    public Credits getJetwotCredits() {
        String key = "jetslide.twitter4j.jetwot.";
        return new Credits(get(key + "token"), get(key + "tokenSecret"),
                get(key + "consumerKey"), get(key + "consumerSecret"));
    }
View Full Code Here

    public void installRMIModule() {
        bind(RMIServer.class).toInstance(new RMIServer(config));
    }

    public void installTwitterModule() {
        final Credits cred = config.getTwitterSearchCredits();
//        logger.info("TWITTER:"+cred.getConsumerKey() + " " + cred.getConsumerSecret());
//        logger.info(cred.getToken() + " " + cred.getTokenSecret());

        final TwitterSearch ts = createTwitterSearch().setConsumer(
                cred.getConsumerKey(), cred.getConsumerSecret());

        try {
            ts.initTwitter4JInstance(cred.getToken(), cred.getTokenSecret(), true);
        } catch (Exception ex) {
            logger.error("Cannot create twitter4j instance!\n######### TWITTER4J ERROR: But start jetwick nevertheless! Error:" + ex);
        }

        bind(TwitterSearch.class).toProvider(new Provider<TwitterSearch>() {

            @Override
            public TwitterSearch get() {
                // avoid exception in this getter: do not call twitter.verify which can fail if twitter down etc
                return createTwitterSearch().setConsumer(
                        cred.getConsumerKey(), cred.getConsumerSecret()).
                        setTwitter4JInstance(ts.getTwitter4JInstance());
            }
        });
    }
View Full Code Here

    private TermCreateCommand command = new TermCreateCommand();
    private Random rand = new Random();

    public void init() {
        Configuration cfg = new Configuration();
        Credits credits = cfg.getJetwotCredits();
        Module module = new DefaultModule();
        Injector injector = Guice.createInjector(module);
        tweetSearch = injector.getInstance(ElasticTweetSearch.class);
        tw4j = new TwitterSearch().setConsumer(credits.getConsumerKey(), credits.getConsumerSecret());
        tw4j.initTwitter4JInstance(credits.getToken(), credits.getTokenSecret(), true);

        try {
            for (JTweet tw : tw4j.getTweets(tw4j.getUser(), new ArrayList<JUser>(), 20)) {
                command.calcTermsWithoutNoise(tw);
                addToCaches(tw);
View Full Code Here

TOP

Related Classes of de.jetwick.tw.Credits

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.