Skip to content

Commit

Permalink
OAuthUpdate now supports PIN
Browse files Browse the repository at this point in the history
git-svn-id: http://yusuke.homeip.net/svn/twitter4j/trunk@382 117b7e0d-5933-0410-9d29-ab41bb01d86b
  • Loading branch information
yusuke committed Oct 3, 2009
1 parent 10cbea5 commit f03a5c8
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/main/java/twitter4j/examples/OAuthUpdate.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,14 @@ public static void main(String[] args) {
while (null == accessToken) {
System.out.println("Open the following URL and grant access to your account:");
System.out.println(requestToken.getAuthorizationURL());
System.out.print("Hit enter when it's done.[Enter]:");
br.readLine();
System.out.print("Enter the PIN(if available) and hit enter after you granted access.[PIN]:");
String pin = br.readLine();
try{
accessToken = requestToken.getAccessToken();
if(pin.length() > 0){
accessToken = twitter.getOAuthAccessToken(requestToken, pin);
}else{
accessToken = requestToken.getAccessToken();
}
} catch (TwitterException te) {
if(401 == te.getStatusCode()){
System.out.println("Unable to get the access token.");
Expand Down

0 comments on commit f03a5c8

Please sign in to comment.