diff options
author | Evan Prodromou <evan@status.net> | 2010-01-08 00:20:38 -0800 |
---|---|---|
committer | Evan Prodromou <evan@status.net> | 2010-01-08 00:20:38 -0800 |
commit | 054aaa40bf89fd6726f16fb6dcfe6dfab03ef45c (patch) | |
tree | 065f6ca6c628912233ca327cf92652525155cc9c /plugins | |
parent | 505cd382f3d0d37f3d9581a907877e644b5118fd (diff) |
add versions for url-shortener plugins
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/BitlyUrl/BitlyUrlPlugin.php | 14 | ||||
-rw-r--r-- | plugins/LilUrl/LilUrlPlugin.php | 17 | ||||
-rw-r--r-- | plugins/PtitUrl/PtitUrlPlugin.php | 13 | ||||
-rw-r--r-- | plugins/SimpleUrl/SimpleUrlPlugin.php | 13 | ||||
-rw-r--r-- | plugins/TightUrl/TightUrlPlugin.php | 12 |
5 files changed, 66 insertions, 3 deletions
diff --git a/plugins/BitlyUrl/BitlyUrlPlugin.php b/plugins/BitlyUrl/BitlyUrlPlugin.php index 65d0f70e6..f7f28b4d6 100644 --- a/plugins/BitlyUrl/BitlyUrlPlugin.php +++ b/plugins/BitlyUrl/BitlyUrlPlugin.php @@ -49,6 +49,18 @@ class BitlyUrlPlugin extends UrlShortenerPlugin if(!$response) return; return current(json_decode($response)->results)->hashUrl; } -} + function onPluginVersion(&$versions) + { + $versions[] = array('name' => sprintf('BitlyUrl (%s)', $this->shortenerName), + 'version' => STATUSNET_VERSION, + 'author' => 'Craig Andrews', + 'homepage' => 'http://status.net/wiki/Plugin:BitlyUrl', + 'rawdescription' => + sprintf(_m('Uses <a href="http://%1$s/">%1$s</a> URL-shortener service.'), + $this->shortenerName)); + + return true; + } +} diff --git a/plugins/LilUrl/LilUrlPlugin.php b/plugins/LilUrl/LilUrlPlugin.php index 4a6f1cdc7..c3e37c0c0 100644 --- a/plugins/LilUrl/LilUrlPlugin.php +++ b/plugins/LilUrl/LilUrlPlugin.php @@ -46,9 +46,9 @@ class LilUrlPlugin extends UrlShortenerPlugin protected function shorten($url) { $data = array('longurl' => $url); - + $responseBody = $this->http_post($this->serviceUrl,$data); - + if (!$responseBody) return; $y = @simplexml_load_string($responseBody); if (!isset($y->body)) return; @@ -57,5 +57,18 @@ class LilUrlPlugin extends UrlShortenerPlugin return strval($x['href']); } } + + function onPluginVersion(&$versions) + { + $versions[] = array('name' => sprintf('LilUrl (%s)', $this->shortenerName), + 'version' => STATUSNET_VERSION, + 'author' => 'Craig Andrews', + 'homepage' => 'http://status.net/wiki/Plugin:LilUrl', + 'rawdescription' => + sprintf(_m('Uses <a href="http://%1$s/">%1$s</a> URL-shortener service.'), + $this->shortenerName)); + + return true; + } } diff --git a/plugins/PtitUrl/PtitUrlPlugin.php b/plugins/PtitUrl/PtitUrlPlugin.php index 76a438dd5..ddba942e6 100644 --- a/plugins/PtitUrl/PtitUrlPlugin.php +++ b/plugins/PtitUrl/PtitUrlPlugin.php @@ -56,5 +56,18 @@ class PtitUrlPlugin extends UrlShortenerPlugin return strval($xml['href']); } } + + function onPluginVersion(&$versions) + { + $versions[] = array('name' => sprintf('PtitUrl (%s)', $this->shortenerName), + 'version' => STATUSNET_VERSION, + 'author' => 'Craig Andrews', + 'homepage' => 'http://status.net/wiki/Plugin:PtitUrl', + 'rawdescription' => + sprintf(_m('Uses <a href="http://%1$s/">%1$s</a> URL-shortener service.'), + $this->shortenerName)); + + return true; + } } diff --git a/plugins/SimpleUrl/SimpleUrlPlugin.php b/plugins/SimpleUrl/SimpleUrlPlugin.php index 45b745b07..6eac7dbb1 100644 --- a/plugins/SimpleUrl/SimpleUrlPlugin.php +++ b/plugins/SimpleUrl/SimpleUrlPlugin.php @@ -47,5 +47,18 @@ class SimpleUrlPlugin extends UrlShortenerPlugin protected function shorten($url) { return $this->http_get(sprintf($this->serviceUrl,urlencode($url))); } + + function onPluginVersion(&$versions) + { + $versions[] = array('name' => sprintf('SimpleUrl (%s)', $this->shortenerName), + 'version' => STATUSNET_VERSION, + 'author' => 'Craig Andrews', + 'homepage' => 'http://status.net/wiki/Plugin:SimpleUrl', + 'rawdescription' => + sprintf(_m('Uses <a href="http://%1$s/">%1$s</a> URL-shortener service.'), + $this->shortenerName)); + + return true; + } } diff --git a/plugins/TightUrl/TightUrlPlugin.php b/plugins/TightUrl/TightUrlPlugin.php index 6ced9afdc..e2d494a7b 100644 --- a/plugins/TightUrl/TightUrlPlugin.php +++ b/plugins/TightUrl/TightUrlPlugin.php @@ -57,4 +57,16 @@ class TightUrlPlugin extends UrlShortenerPlugin return strval($xml['href']); } } + + function onPluginVersion(&$versions) + { + $versions[] = array('name' => sprintf('TightUrl (%s)', $this->shortenerName), + 'version' => STATUSNET_VERSION, + 'author' => 'Craig Andrews', + 'homepage' => 'http://status.net/wiki/Plugin:TightUrl', + 'rawdescription' => + sprintf(_m('Uses <a href="http://%1$s/">%1$s</a> URL-shortener service.'), + $this->shortenerName)); + return true; + } } |