diff options
author | Matthias H <apoc@sixserv.org> | 2014-02-20 23:28:52 +0100 |
---|---|---|
committer | Matthias H <apoc@sixserv.org> | 2014-02-20 23:28:52 +0100 |
commit | 8fcda482961f90edad361dd7a47fb2a8dfeb5c70 (patch) | |
tree | 2958ad50d33c47116e4826748cfec5c79aa87389 /data/rbot/plugins/spotify.rb | |
parent | fe6ae0ecaf02182ac5404e7ace3c24b96a12ee9a (diff) |
[plugin] spotify plugin removed
Diffstat (limited to 'data/rbot/plugins/spotify.rb')
-rw-r--r-- | data/rbot/plugins/spotify.rb | 78 |
1 files changed, 0 insertions, 78 deletions
diff --git a/data/rbot/plugins/spotify.rb b/data/rbot/plugins/spotify.rb deleted file mode 100644 index 29331c00..00000000 --- a/data/rbot/plugins/spotify.rb +++ /dev/null @@ -1,78 +0,0 @@ -#-- vim:sw=2:et -#++ -# -# :title: spotify plugin for rbot -# -# Author:: Raine Virta <raine.virta@gmail.com> -# -# Copyright:: (C) 2009 Raine Virta -# -# License:: GPL v2 - -class SpotifyPlugin < Plugin - def initialize - super - - unless Object.const_defined?('Spotify') - raise 'Spotify module not found (lib_spotify plugin probably not enabled)' - end - end - - def help(plugin, topic) - _("spotify plugin - usage: spotify <spotify>, spotify artist <artist>, spotify album <album>") - end - - def search(m, params) - method = params[:method] || 'track' - begin - result = Spotify.search(method, params[:query].to_s) - rescue - m.reply "problems connecting to Spotify" - end - - if result.nil? - m.reply "no results" - return - end - - case method - when 'track' - reply = _("%{b}%{artist}%{b} – %{track}") % { - :artist => result.artist.name, - :track => result.name, - :b => Bold - } - - if result.album.released - reply << _(" [%{u}%{album}%{u}, %{released}]") % { - :released => result.album.released, - :album => result.album.name, - :u => Underline - } - else - reply << _(" [%{u}%{album}%{u}]") % { :album => result.album.name, :u => Underline } - end - - reply << _(" — %{url}") % { :url => result.url } - when 'artist' - reply = _("%{b}%{artist}%{b} — %{url}") % { - :b => Bold, - :artist => result.name, - :url => result.url - } - when 'album' - reply = _("%{b}%{artist}%{b} – %{u}%{album}%{u} — %{url}") % { - :b => Bold, - :u => Underline, - :artist => result.artist.name, - :album => result.name, - :url => result.url - } - end - - m.reply reply - end -end - -plugin = SpotifyPlugin.new -plugin.map 'spotify [:method] *query', :action => :search, :requirements => { :method => /track|artist|album/ } |