ConfigurationBuilder configBuilder = new ConfigurationBuilder();
configBuilder.setDebugEnabled(true)
.setOAuthConsumerKey(new Tokens().OAuthConsumerKey)
.setOAuthConsumerSecret(new Tokens().OAuthConsumerSecret);
Twitter OAuthTwitter = new TwitterFactory(configBuilder.build()).getInstance();
RequestToken requestToken = null;
AccessToken accessToken = null;
String url = null;
do {
try {
requestToken = OAuthTwitter.getOAuthRequestToken();
System.out.println("Request Tokens obtenidos con éxito.");
/*System.out.println("Request Token: " + requestToken.getToken());
System.out.println("Request Token secret: " + requestToken.getTokenSecret());*/
url = requestToken.getAuthorizationURL();
} catch (TwitterException ex) {
Logger.getLogger(TwitterJavaGT.class.getName()).log(Level.SEVERE, null, ex);
}
BufferedReader lectorTeclado = new BufferedReader(new InputStreamReader(System.in));
//Abro el navegador.