}
}
}
try {
Twitter twitter = new TwitterFactory().getInstance();
RequestToken requestToken = twitter.getOAuthRequestToken();
System.out.println("Got request token.");
System.out.println("Request token: " + requestToken.getToken());
System.out.println("Request token secret: " + requestToken.getTokenSecret());
AccessToken accessToken = null;
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
while (null == accessToken) {
System.out.println("Open the following URL and grant access to your account:");
System.out.println(requestToken.getAuthorizationURL());
try {
Desktop.getDesktop().browse(new URI(requestToken.getAuthorizationURL()));
} catch (UnsupportedOperationException ignore) {
} catch (IOException ignore) {
} catch (URISyntaxException e) {
throw new AssertionError(e);
}