You are here

private function StatusTwitter::generateRequest in Heartbeat 8

File

modules/statusmessage/src/StatusTwitter.php, line 103

Class

StatusTwitter

Namespace

Drupal\statusmessage

Code

private function generateRequest($url) {
  $twid = $this
    ->parseUrl($url);
  $settings = [
    'oauth_access_token' => $this->twitterConfig
      ->get('oauth_access_token'),
    'oauth_access_token_secret' => $this->twitterConfig
      ->get('oauth_access_token_secret'),
    'consumer_key' => $this->twitterConfig
      ->get('consumer_key'),
    'consumer_secret' => $this->twitterConfig
      ->get('consumer_secret'),
  ];
  $twitterApi = new TwitterAPIExchange($settings);
  $getField = '?id=' . $twid . '&tweet_mode=extended';
  return $twitterApi
    ->setGetfield($getField)
    ->buildOauth(self::getApiStatusParameter(), 'GET');
}