// Specify the consumer key and consumer secret
// via system properties or configurationbuilder
System.setProperty("twitter4j.oauth.consumerKey",TWITTER_CONSUMER);
System.setProperty("twitter4j.oauth.consumerSecret",TWITTER_SECRET);
// Then authenticate as normal
Twitter twitter = new TwitterFactory().getInstance(username,
password);
// Next the token will be available to you
AccessToken token = twitter.getOAuthAccessToken();
// You must store the access token and reuse this token
twitter.setOAuthAccessToken(token);
0 comments:
Post a Comment