Example usage for twitter4j.auth OAuthAuthorization getOAuthRequestToken

List of usage examples for twitter4j.auth OAuthAuthorization getOAuthRequestToken

Introduction

In this page you can find the example usage for twitter4j.auth OAuthAuthorization getOAuthRequestToken.

Prototype

@Override
    public RequestToken getOAuthRequestToken() throws TwitterException 

Source Link

Usage

From source file:hashimotonet.UpdateStatus.java

License:Apache License

/**
 * Twitter?//w  w w .ja  va 2s  .c  o  m
 * @throws TwitterException 
 */
private void connectTwitter() throws TwitterException {
    // Twitetr4j??
    Configuration conf = ConfigurationContext.getInstance();
    // OauthF?IuWFNg??
    OAuthAuthorization Oauth = new OAuthAuthorization(conf);
    // OauthF?IuWFNgconsumerKeyconsumerSecret?
    Oauth.setOAuthConsumer(Globals.KEY, Globals.SECRET);

    //       // NGXgg?[N??
    RequestToken sRequestToken = null;
    try {
        sRequestToken = Oauth.getOAuthRequestToken();
    } catch (TwitterException e) {
        throw new TwitterException(e.toString());
    }
    String url = sRequestToken.getAuthorizationURL();
    System.out.println("Url = " + url);
}