Package twitter4j.conf

Examples of twitter4j.conf.PropertyConfiguration


        context.addNotification("Uploading to TwitPic");

        new Thread(new Runnable(){
            public void run() {
                try {
                    Configuration conf = new PropertyConfiguration(new Properties());
                    OAuthAuthorization oauth = new OAuthAuthorization(conf,consumerKey,consumerSecret,token);
                    ImageUpload upload = ImageUpload.getTwitpicUploader(TWITPIC_API,oauth);
                    final String resultUrl = upload.upload(file,message);
                    Status s = twitter.updateStatus(message + " " + resultUrl);
                    final String tweetUrl = "http://twitter.com/"+s.getUser().getScreenName()+"/status/"+s.getId();
View Full Code Here


        Properties props = new Properties();
        //props.put(PropertyConfiguration.SOURCE,"Jopr");
        props.put(PropertyConfiguration.HTTP_USER_AGENT,"Jopr");
        props.put(PropertyConfiguration.SEARCH_BASE_URL, searchBase);
        props.put(PropertyConfiguration.REST_BASE_URL, serverUrl);
        twitter4j.conf.Configuration tconf = new PropertyConfiguration(props);

        tFactory = new TwitterFactory(tconf);
    }
View Full Code Here

       Properties props = new Properties();
       //props.put(PropertyConfiguration.SOURCE,"Jopr");
       props.put(PropertyConfiguration.HTTP_USER_AGENT,"Jopr");
       props.put(PropertyConfiguration.SEARCH_BASE_URL,searchBaseUrl);
       props.put(PropertyConfiguration.REST_BASE_URL,serverUrl);
       twitter4j.conf.Configuration tconf = new PropertyConfiguration(props);

        tFactory = new TwitterFactory(tconf);


    }
View Full Code Here

    private Twitter createTwitterInstance() {
        Properties props = new Properties();
        props.setProperty(PropertyConfiguration.USER, username);
        props.setProperty(PropertyConfiguration.PASSWORD, password);
        PropertyConfiguration propConfig = new PropertyConfiguration(props);
        return tFactory.getInstance(AuthorizationFactory.getInstance(propConfig));
    }
View Full Code Here

        desktopConsumerSecret = p.getProperty("oauth.consumerSecret");
        desktopConsumerKey = p.getProperty("oauth.consumerKey");
        browserConsumerSecret = p.getProperty("browser.oauth.consumerSecret");
        browserConsumerKey = p.getProperty("browser.oauth.consumerKey");

        conf1 = new PropertyConfiguration(p, "/id1");
        id1 = new TestUserInfo("id1");
        conf2 = new PropertyConfiguration(p, "/id2");
        id2 = new TestUserInfo("id2");
        conf3 = new PropertyConfiguration(p, "/id3");
        id3 = new TestUserInfo("id3");
        bestFriend1Conf = new PropertyConfiguration(p, "/bestFriend1");
        bestFriend1 = new TestUserInfo("bestFriend1");
        bestFriend2Conf = new PropertyConfiguration(p, "/bestFriend2");
        bestFriend2 = new TestUserInfo("bestFriend2");

        numberId = p.getProperty("numberid.user");
        numberPass = p.getProperty("numberid.password");
//        id1id = Integer.valueOf(p.getProperty("id1id"));
View Full Code Here

    Properties props = new Properties();
    props.setProperty(PropertyConfiguration.OAUTH_CONSUMER_KEY, getConsumerKey());
    props.setProperty(PropertyConfiguration.OAUTH_CONSUMER_SECRET, getConsumerSecret());
    props.setProperty(PropertyConfiguration.OAUTH_ACCESS_TOKEN, accessToken);
    props.setProperty(PropertyConfiguration.OAUTH_ACCESS_TOKEN_SECRET, secret);
    Configuration conf = new PropertyConfiguration(props);
    return new TwitterFactory(conf).getInstance();
  }
View Full Code Here

        if (null == is) {
            System.out.println("xauth-test.properties not found. skipping xAuth test.");
        } else {
            Properties props = new Properties();
            props.load(is);
            Configuration conf = new PropertyConfiguration(props);
            twitter = new TwitterFactory(conf).getInstance();
            AccessToken at = twitter.getOAuthAccessToken(id1.screenName, id1.password);
            twitter.updateStatus(new Date() + ": xAuth test.");

            twitter = new TwitterFactory().getInstance();
            twitter.setOAuthConsumer(conf.getOAuthConsumerKey(), conf.getOAuthConsumerSecret());
            twitter.getOAuthAccessToken(id1.screenName, id1.password);
        }

    }
View Full Code Here

        desktopConsumerSecret = p.getProperty("oauth.consumerSecret");
        desktopConsumerKey = p.getProperty("oauth.consumerKey");
        browserConsumerSecret = p.getProperty("browser.oauth.consumerSecret");
        browserConsumerKey = p.getProperty("browser.oauth.consumerKey");

        conf1 = new PropertyConfiguration(p, "/id1");
        id1 = new TestUserInfo("id1");
        conf2 = new PropertyConfiguration(p, "/id2");
        id2 = new TestUserInfo("id2");
        conf3 = new PropertyConfiguration(p, "/id3");
        id3 = new TestUserInfo("id3");
        rwPrivateMessage = new TwitterFactory(new PropertyConfiguration(p, "/r-w-private")).getInstance();
        Configuration bestFriend1Conf = new PropertyConfiguration(p, "/bestFriend1");
        bestFriend1 = new TestUserInfo("bestFriend1");
        Configuration bestFriend2Conf = new PropertyConfiguration(p, "/bestFriend2");
        bestFriend2 = new TestUserInfo("bestFriend2");

        numberId = p.getProperty("numberid.user");
        numberPass = p.getProperty("numberid.password");
//        id1id = Integer.valueOf(p.getProperty("id1id"));
        numberIdId = Integer.valueOf(p.getProperty("numberid.id"));

        twitter1 = new TwitterFactory(conf1).getInstance();

        twitter2 = new TwitterFactory(conf2).getInstance();

        twitter3 = new TwitterFactory(conf3).getInstance();

        twitterAPIBestFriend1 = new TwitterFactory(bestFriend1Conf).getInstance();

        twitterAPIBestFriend2 = new TwitterFactory(bestFriend2Conf).getInstance();

        followsOneWay = p.getProperty("followsOneWay");

        readonly = new TwitterFactory(new PropertyConfiguration(p, "/readonly")).getInstance();
    }
View Full Code Here

        desktopConsumerSecret = p.getProperty("oauth.consumerSecret");
        desktopConsumerKey = p.getProperty("oauth.consumerKey");
        browserConsumerSecret = p.getProperty("browser.oauth.consumerSecret");
        browserConsumerKey = p.getProperty("browser.oauth.consumerKey");

        conf1 = new PropertyConfiguration(p, "/id1");
        id1 = new TestUserInfo("id1");
        conf2 = new PropertyConfiguration(p, "/id2");
        id2 = new TestUserInfo("id2");
        conf3 = new PropertyConfiguration(p, "/id3");
        id3 = new TestUserInfo("id3");
        bestFriend1Conf = new PropertyConfiguration(p, "/bestFriend1");
        bestFriend1 = new TestUserInfo("bestFriend1");
        bestFriend2Conf = new PropertyConfiguration(p, "/bestFriend2");
        bestFriend2 = new TestUserInfo("bestFriend2");

        numberId = p.getProperty("numberid.user");
        numberPass = p.getProperty("numberid.password");
//        id1id = Integer.valueOf(p.getProperty("id1id"));
View Full Code Here

            System.out.println("sitestream-test.properties not found. skipping Site Streams test.");
        } else {
            Properties props = new Properties();
            props.load(is);
            is.close();
            Configuration yusukeyConf = new PropertyConfiguration(props, "/yusukey");
            Configuration twit4jConf = new PropertyConfiguration(props, "/id1");
            Configuration twit4j2Conf = new PropertyConfiguration(props, "/id2");
            TwitterStream twitterStream = new TwitterStreamFactory(yusukeyConf).getInstance();
            twitterStream.addListener(this);
            Twitter twit4j = new TwitterFactory(twit4jConf).getInstance();
            Twitter twit4j2 = new TwitterFactory(twit4j2Conf).getInstance();
            try {
View Full Code Here

TOP

Related Classes of twitter4j.conf.PropertyConfiguration

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.