]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/Spotify/SpotifyPlugin.php
Merge branch 'master' into social-master
[quix0rs-gnu-social.git] / plugins / Spotify / SpotifyPlugin.php
index e7a5a5382635c86ebd58017b36823332d6e70636..2754d180218683c0e96fad4ae2ba8ef7f0bcfa59 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /**
  * StatusNet, the distributed open-source microblogging tool
 *
+ *
  * Plugin to create pretty Spotify URLs
  *
  * PHP version 5
@@ -47,16 +47,14 @@ define('SPOTIFYPLUGIN_VERSION', '0.1');
  *
  * @see       Event
  */
-
 class SpotifyPlugin extends Plugin
 {
-
     function __construct()
     {
         parent::__construct();
     }
 
-    function onStartNoticeSave($notice)
+    function onStartNoticeSave(Notice $notice)
     {
         $notice->rendered = preg_replace_callback('/spotify:[a-z]{5,6}:[a-z0-9]{22}/i',
                                                   "renderSpotifyURILink",
@@ -69,13 +67,21 @@ class SpotifyPlugin extends Plugin
         return true;
     }
 
-    function userAgent()
+    function onPluginVersion(array &$versions)
     {
-        return 'SpotifyPlugin/'.SPOTIFYPLUGIN_VERSION .
-               ' StatusNet/' . STATUSNET_VERSION;
+        $versions[] = array('name' => 'Spotify',
+                            'version' => SPOTIFYPLUGIN_VERSION,
+                            'author' => 'Nick Holliday',
+                            'homepage' => 'http://status.net/wiki/Plugin:Spotify',
+                            'rawdescription' =>
+                            // TRANS: Plugin description.
+                            _m('Create pretty <a href="http://www.spotify.com">Spotify</a> URLs.'));
+
+        return true;
     }
 }
 
+// @todo FIXME: This probably should not be global functions.
 function doSpotifyLookup($uri, $isArtist)
 {
     $request = HTTPClient::start();