forked from GNUsocial/gnu-social
		
	trac31 added bit.ly support
darcs-hash:20081107201926-099f7-bee53da36841b7dc048591ed91ea35d3e3522d34.gz
This commit is contained in:
		@@ -45,6 +45,7 @@ class OthersettingsAction extends SettingsAction {
 | 
			
		||||
            'ur1.ca' => 'ur1.ca (free)',
 | 
			
		||||
            '2tu.ru' => '2tu.ru (free)',
 | 
			
		||||
            'ptiturl.com' => 'ptiturl.com',
 | 
			
		||||
            'bit.ly' => 'bit.ly',
 | 
			
		||||
			'tinyurl.com' => 'tinyurl.com',
 | 
			
		||||
			'is.gd' => 'is.gd',
 | 
			
		||||
			'snipr.com' => 'snipr.com',
 | 
			
		||||
 
 | 
			
		||||
@@ -778,6 +778,11 @@ function common_shorten_link($long_url) {
 | 
			
		||||
            $short_url = $short_url_service->shorten($long_url);
 | 
			
		||||
            break;
 | 
			
		||||
 | 
			
		||||
        case 'bit.ly':
 | 
			
		||||
			curl_setopt($curlh, CURLOPT_URL, 'http://bit.ly/api?method=shorten&long_url='.urlencode($long_url));
 | 
			
		||||
			$short_url = current(json_decode(curl_exec($curlh))->results)->hashUrl;
 | 
			
		||||
            break;
 | 
			
		||||
 | 
			
		||||
		case 'is.gd':
 | 
			
		||||
			curl_setopt($curlh, CURLOPT_URL, 'http://is.gd/api.php?longurl='.urlencode($long_url));
 | 
			
		||||
			$short_url = curl_exec($curlh);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user