You are here

protected function Twitter::create_url in Twitter 7.6

Same name and namespace in other branches
  1. 6.5 twitter.lib.php \Twitter::create_url()
  2. 6.3 twitter.lib.php \Twitter::create_url()
  3. 7.3 twitter.lib.php \Twitter::create_url()
  4. 7.5 twitter.lib.php \Twitter::create_url()

Creates an API endpoint URL.

Parameters

string $path: The path of the endpoint.

string $format: The format of the endpoint to be appended at the end of the path.

bool $extended: If set to TRUE, sets the endpoint to retrieve the extended mode version of the tweet. If set to FALSE, sets the endpoint to retrieve the compatibility mode version of the tweet.

Return value

The complete path to the endpoint.

1 call to Twitter::create_url()
Twitter::getParsedResponse in ./twitter.lib.php
Retrieves the parsed response of the Twitter API endpoint call.

File

./twitter.lib.php, line 228
Integration layer to communicate with the Twitter REST API 1.1. https://dev.twitter.com/docs/api/1.1

Class

Twitter
Primary Twitter API implementation class

Code

protected function create_url($path, $format = '.json', $extended = FALSE) {
  if ($extended) {
    $url = variable_get('twitter_api', TWITTER_API) . '/1.1/' . $path . $format . '?tweet_mode=extended';
  }
  else {
    $url = variable_get('twitter_api', TWITTER_API) . '/1.1/' . $path . $format;
  }
  return $url;
}