Java examples for Social Media:Twitter
Login to twitter using ConfigurationBuilder
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(); } }