diff options
Diffstat (limited to 'lib/util.php')
-rw-r--r-- | lib/util.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/util.php b/lib/util.php index 634140fef..4f93d572e 100644 --- a/lib/util.php +++ b/lib/util.php @@ -777,7 +777,12 @@ function common_shorten_link($long_url) { $short_url_service = new PtitUrl; $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); |