add versions for url-shortener plugins

This commit is contained in:
Evan Prodromou 2010-01-08 00:20:38 -08:00
parent 505cd382f3
commit 054aaa40bf
5 changed files with 66 additions and 3 deletions

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}