You are here

function TwitterOAuth::oAuthRequest in jQuery social stream 8

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

Format and sign an OAuth / API request

6 calls to TwitterOAuth::oAuthRequest()
TwitterOAuth::delete in src/Twitter/TwitterOAuth.php
DELETE wrapper for oAuthReqeust.
TwitterOAuth::get in src/Twitter/TwitterOAuth.php
GET wrapper for oAuthRequest.
TwitterOAuth::getAccessToken in src/Twitter/TwitterOAuth.php
Exchange request token and secret for an access token and secret, to sign API calls.
TwitterOAuth::getRequestToken in src/Twitter/TwitterOAuth.php
Get a request_token from Twitter
TwitterOAuth::getXAuthToken in src/Twitter/TwitterOAuth.php
One time exchange of username and password for access token and secret.

... See full list

File

src/Twitter/TwitterOAuth.php, line 185

Class

TwitterOAuth
Twitter OAuth class

Namespace

Drupal\jquery_social_stream\Twitter

Code

function oAuthRequest($url, $method, $parameters) {
  if (strrpos($url, 'https://') !== 0 && strrpos($url, 'http://') !== 0) {
    $url = "{$this->host}{$url}.{$this->format}";
  }
  $request = \Drupal\jquery_social_stream\Twitter\OAuthRequest::from_consumer_and_token($this->consumer, $this->token, $method, $url, $parameters);
  $request
    ->sign_request($this->sha1_method, $this->consumer, $this->token);
  switch ($method) {
    case 'GET':
      return $this
        ->http($request
        ->to_url(), 'GET');
    default:
      return $this
        ->http($request
        ->get_normalized_http_url(), $method, $request
        ->to_postdata());
  }
}