You are here

function TwittersOAuth::getAccessToken in jQuery social stream 7

Same name and namespace in other branches
  1. 7.2 jquery_social_stream.js.inc \TwittersOAuth::getAccessToken()

Exchange request token and secret for an access token and secret, to sign API calls.

@returns array("oauth_token" => "the-access-token", "oauth_token_secret" => "the-access-secret", "user_id" => "9436992", "screen_name" => "abraham")

File

./jquery_social_stream.js.inc, line 190
JS callbacks.

Class

TwittersOAuth
Twitter sOAuth class

Code

function getAccessToken($oauth_verifier = FALSE) {
  $parameters = array();
  if (!empty($oauth_verifier)) {
    $parameters['oauth_verifier'] = $oauth_verifier;
  }
  $request = $this
    ->oAuthRequest($this
    ->accessTokenURL(), 'GET', $parameters);
  $token = sOAuthUtil::parse_parameters($request);
  $this->token = new sOAuthConsumer($token['oauth_token'], $token['oauth_token_secret']);
  return $token;
}