function _tweet_make_url in Tweet 5
Same name and namespace in other branches
- 5.2 tweet.module \_tweet_make_url()
- 6 tweet.module \_tweet_make_url()
Retrieves the abbreviated URL from th8.us. Requires that PHP was compiled with file_get_contents available.
Parameters
$q: The URL of the page for which to create the abbreviated URL. If not passed uses the current page.
Return value
An abbreviated URL.
See also
1 call to _tweet_make_url()
- _tweet_to_twitter in ./
tweet.module - Creates a link to post a URL and optionally title to twitter. Uses the current page by default.
File
- ./
tweet.module, line 175 - Builds links to post pages to twitter.
Code
function _tweet_make_url($q = '') {
if (!$q) {
global $base_url;
$q = $base_url . base_path() . $_GET['q'];
}
$url = file_get_contents('http://th8.us/api.php?url=' . $q);
$url = drupal_substr($url, 7);
$url = 'www.' . $url;
return $url;
}