]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
add versions for url-shortener plugins
authorEvan Prodromou <evan@status.net>
Fri, 8 Jan 2010 08:20:38 +0000 (00:20 -0800)
committerEvan Prodromou <evan@status.net>
Fri, 8 Jan 2010 08:20:38 +0000 (00:20 -0800)
plugins/BitlyUrl/BitlyUrlPlugin.php
plugins/LilUrl/LilUrlPlugin.php
plugins/PtitUrl/PtitUrlPlugin.php
plugins/SimpleUrl/SimpleUrlPlugin.php
plugins/TightUrl/TightUrlPlugin.php

index 65d0f70e653a2ed4e82f3c2d223ca8242dd70f7c..f7f28b4d6c53209eaa411bb8721101383f381b75 100644 (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;
+    }
+}
 
index 4a6f1cdc79cdeca5746dbff4344f79c82e6b9a27..c3e37c0c0f358a76bde8bf9633992f947fe7c034 100644 (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;
+    }
 }
 
index 76a438dd5e9ec9f41e98e1ba32ad9e49e6a298bd..ddba942e6d4ab7eb07a8b70306cf5e5f8849cae1 100644 (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;
+    }
 }
 
index 45b745b07d0000a50860ef5042c084d5c280f2e5..6eac7dbb1e37cb15a7154aa600fe7d73ba0ef105 100644 (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;
+    }
 }
 
index 6ced9afdc511d750e7a2d5bcf872fa315bcb95b4..e2d494a7bda4c4ebf2c7714c7a31259b8e7ee18b 100644 (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;
+    }
 }