Lines Matching full:url
34 'desc' => 'returns the short url if exists, otherwise creates the short url',
49 * Generates a short url for the pageID using the required shortening service
50 * and adds the url to the database
80 * Generates a short url using the Bit.ly API
85 // checks if the short url already exists in the database
86 $url = $this->readShortUrl($pageID, $domain);
87 if ($url == false ) {
88 // calls the service API to generate a short url
102 $url = $output->{'data'}->{'url'};
103 // saves the new short url to the database
104 $this->writeShortUrl($pageID, $url, $domain);
107 return $url;
111 * Generates a short url using the yourls API
116 // checks if the short url already exists in the database
117 $url = $this->readShortUrl($pageID, 'yourls');
118 if ($url == false ) {
119 // calls the service API to generate a short url
125 $uri .= "&url=" . $longUrl;
128 $url = $http->get($uri);
129 // saves the new short url to the database
130 $this->writeShortUrl($pageID, $url, 'yourls');
134 return $url;
139 * Generates a short url using the Tinyurl API
144 // checks if the short url already exists in the database
145 $url = $this->readShortUrl($pageID, 'tinyurl');
146 if ($url == false ) {
147 // calls the service API to generate a short url
150 $url = $http->get('http://tinyurl.com/api-create.php?url='.$longUrl);
151 // saves the new short url to the database
152 $this->writeShortUrl($pageID, $url, 'tinyurl');
154 return $url;
179 $url = $output[0];
181 if ( $redirects["$url"] && $redirects["$url"] != $pageID ) {
182 $url = $output[$j+1];