}
}
public static String testAccessToken() {
try {
OAuthDoubanProvider oauth = new OAuthDoubanProvider();
oauth.setApiKey("xxx").setSecretKey("xxx");
oauth.addScope(RequestGrantScope.BASIC_COMMON_SCOPE).addScope(RequestGrantScope.SHUO_READ_SCOPE).addScope(RequestGrantScope.SHUO_WRITE_SCOPE)
.addScope(RequestGrantScope.BASIC_NOTE_SCOPE).addScope(RequestGrantScope.BOOK_READ_SCOPE).addScope(RequestGrantScope.EVENT_READ_SCOPE).addScope(RequestGrantScope.EVENT_WRITE_SCOPE)
.addScope(RequestGrantScope.MAIL_READ_SCOPE).addScope(RequestGrantScope.MAIL_WRITE_SCOPE).addScope(RequestGrantScope.MOVIE_READ_SCOPE).addScope(RequestGrantScope.MUSIC_READ_SCOPE);
oauth.setRedirectUrl("http://www.dongxuexidu.com");
BrowserLauncher.openURL(oauth.getGetCodeRedirectUrl());
System.out.println(oauth.getGetCodeRedirectUrl());
System.out.print("Put the code you got here.[Enter]:");
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String code = br.readLine();
System.out.println("code : " + code);
AccessToken at = oauth.tradeAccessTokenWithCode(code);
System.out.println("at : " + at.getAccessToken());
System.out.println("uid : " + at.getDoubanUserId());
return at.getAccessToken();
} catch (DoubanException ex) {
Logger.getLogger(PlayGround.class.getName()).log(Level.SEVERE, null, ex);