summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2008-07-04 00:13:41 +0200
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2008-07-04 00:13:41 +0200
commit6045de0659fe340a6a95d6ee4984a5a4753ce3cc (patch)
treea1cc30eb254ebafedbc33e9426f9ffb053180cb9
parent52859bb65d4de803a39cd8bda46618d2aea64c50 (diff)
lastfm plugin: reinstate 1.0 API functions for which we don't have a working 2.0 routine yet
-rw-r--r--data/rbot/plugins/lastfm.rb12
1 files changed, 10 insertions, 2 deletions
diff --git a/data/rbot/plugins/lastfm.rb b/data/rbot/plugins/lastfm.rb
index 2e5dc3f5..7c0309e1 100644
--- a/data/rbot/plugins/lastfm.rb
+++ b/data/rbot/plugins/lastfm.rb
@@ -341,9 +341,15 @@ class LastFmPlugin < Plugin
end
end
+ # TODO this user data retrieval should be upgraded to API 2.0 but it would need separate parsing
+ # for each dataset, or almost
def lastfm(m, params)
action = params[:action].intern
action = :neighbours if action == :neighbors
+ action = :recenttracks if action == :recentracks
+ action = :topalbums if action == :topalbum
+ action = :topartists if action == :topartist
+ action = :toptags if action == :toptag
user = nil
if params[:user] then
user = params[:user].to_s
@@ -378,7 +384,9 @@ plugin.map 'lastfm set verb :present :past', :action => :set_verb, :thread => tr
plugin.map 'lastfm who :who', :action => :get_user, :thread => true
plugin.map 'lastfm who', :action => :get_user, :thread => true
plugin.map 'lastfm compare :user1 :user2', :action => :tasteometer, :thread => true
-#plugin.map 'lastfm :action :user', :thread => true
-#plugin.map 'lastfm :action', :thread => true
plugin.map 'np', :action => :now_playing, :thread => true
plugin.map 'lastfm', :action => :now_playing, :thread => true
+plugin.map "lastfm [user] :action [:user]", :thread => true,
+ :requirements => { :action =>
+ /^(?:events|friends|neighbou?rs|playlists|recent?tracks|top(?:album|artist|tag)s?|weekly(?:album|artist|track)chart|weeklychartlist)$/
+}