public static void main(String args[]) throws Exception {
String oAuthConsumerKey = args[0];
String oAuthConsumerSecret = args[1];
// The factory instance is re-useable and thread safe.
Twitter twitter = new TwitterFactory().getInstance();
twitter.setOAuthConsumer(oAuthConsumerKey, oAuthConsumerSecret);
RequestToken requestToken = twitter.getOAuthRequestToken("oob");
AccessToken accessToken = null;
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
while (null == accessToken) {