]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
trac31 added 3 more short url services: ur1.ca, 2tu.ru and ptiturl.com
authormillette <millette@controlyourself.ca>
Fri, 7 Nov 2008 19:47:35 +0000 (14:47 -0500)
committermillette <millette@controlyourself.ca>
Fri, 7 Nov 2008 19:47:35 +0000 (14:47 -0500)
darcs-hash:20081107194735-099f7-fe1ef28b4d36e5dde9e6addc287ad22946b060cd.gz

actions/othersettings.php
lib/util.php

index d87f256fac06810835597c0a000033871066499d..4e28a94f80df74a9283d503ba6c3944bb9aed5ac 100644 (file)
@@ -42,6 +42,9 @@ class OthersettingsAction extends SettingsAction {
                
                $services = array(
                        '' => 'None',
+            'ur1.ca' => 'ur1.ca (free)',
+            '2tu.ru' => '2tu.ru (free)',
+            'ptiturl.com' => 'ptiturl.com',
                        'tinyurl.com' => 'tinyurl.com',
                        'is.gd' => 'is.gd',
                        'snipr.com' => 'snipr.com',
index eac18e55eff33028579fbb87d24511eb62f9c5a1..634140fef5bb9b3e407b6f86f8baf904e80834d0 100644 (file)
@@ -763,6 +763,21 @@ function common_shorten_link($long_url) {
        curl_setopt($curlh, CURLOPT_RETURNTRANSFER, true);
        
        switch($user->urlshorteningservice) {
+        case 'ur1.ca':
+            $short_url_service = new LilUrl;
+            $short_url = $short_url_service->shorten($long_url);
+            break;
+            
+        case '2tu.ru':
+            $short_url_service = new TightUrl;
+            $short_url = $short_url_service->shorten($long_url);
+            break;
+            
+        case 'ptiturl.com':
+            $short_url_service = new PtitUrl;
+            $short_url = $short_url_service->shorten($long_url);
+            break;
+            
                case 'is.gd':
                        curl_setopt($curlh, CURLOPT_URL, 'http://is.gd/api.php?longurl='.urlencode($long_url));
                        $short_url = curl_exec($curlh);