Login to twitter using ConfigurationBuilder - Java Social Media

Java examples for Social Media:Twitter

Description

Login to twitter using ConfigurationBuilder

Demo Code

import twitter4j.Twitter;
import twitter4j.TwitterFactory;
import twitter4j.conf.ConfigurationBuilder;

public class oath_setter {

    public static void main(String[] args) {

        ConfigurationBuilder cb = new ConfigurationBuilder();
        cb.setDebugEnabled(true)//  w  w w.  j  av a 2 s .co m
                .setOAuthConsumerKey("a")
                .setOAuthConsumerSecret(
                        "a")
                .setOAuthAccessToken(
                        "a-a")
                .setOAuthAccessTokenSecret(
                        "a");
        TwitterFactory tf = new TwitterFactory(cb.build());
        Twitter twitter = tf.getInstance();

    }

}

Related Tutorials