You are here

function TwitterOAuth::getRequestToken in jQuery social stream 8.2

Same name and namespace in other branches
  1. 8 src/Twitter/TwitterOAuth.php \Drupal\jquery_social_stream\Twitter\TwitterOAuth::getRequestToken()

Get a request_token from Twitter

@returns a key/value array containing oauth_token and oauth_token_secret

File

src/Twitter/TwitterOAuth.php, line 81

Class

TwitterOAuth
Twitter OAuth class

Namespace

Drupal\jquery_social_stream\Twitter

Code

function getRequestToken($oauth_callback = NULL) {
  $parameters = array();
  if (!empty($oauth_callback)) {
    $parameters['oauth_callback'] = $oauth_callback;
  }
  $request = $this
    ->oAuthRequest($this
    ->requestTokenURL(), 'GET', $parameters);
  $token = OAuthUtil::parse_parameters($request);
  $this->token = new OAuthConsumer($token['oauth_token'], $token['oauth_token_secret']);
  return $token;
}