diff options
author | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2012-09-26 22:28:25 +0200 |
---|---|---|
committer | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2012-09-26 22:28:25 +0200 |
commit | 47eba1a679d626a94f811accf4a60a5eebc28498 (patch) | |
tree | ae74efb2ba53a1191143afb6bf18c870e4e514e9 /data/rbot | |
parent | 3bafb0933ecf940c51b0f1858d47e50e1ee4f585 (diff) |
lastfm: match latest API changes
Thanks Lite_
Diffstat (limited to 'data/rbot')
-rw-r--r-- | data/rbot/plugins/lastfm.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/data/rbot/plugins/lastfm.rb b/data/rbot/plugins/lastfm.rb index 4255e8a5..e29ae31e 100644 --- a/data/rbot/plugins/lastfm.rb +++ b/data/rbot/plugins/lastfm.rb @@ -354,7 +354,7 @@ class LastFmPlugin < Plugin end first = doc.root.elements[1].elements[1] now = first.attributes["nowplaying"] - artist = first.elements["artist"].text + artist = first.elements["artist/name"].text track = first.elements["name"].text albumtxt = first.elements["album"].text album = if albumtxt @@ -412,7 +412,7 @@ class LastFmPlugin < Plugin tags_xml = @bot.httputil.get("#{APIURL}method=artist.gettoptags&artist=#{CGI.escape params[:artist].to_s}") tags_doc = Document.new tags_xml - first = info_doc.root.elements["artist"] + first = info_doc.root.elements["artist/name"] artist = first.elements["name"].text url = first.elements["url"].text stats = {} @@ -456,7 +456,7 @@ class LastFmPlugin < Plugin doc.root.each_element("results/trackmatches/track") do |trck| hits << _("%{bold}%{t}%{bold} by %{bold}%{a}%{bold} (%{n} listeners)") % { :t => trck.elements["name"].text, - :a => trck.elements["artist"].text, + :a => trck.elements["artist/name"].text, :n => trck.elements["listeners"].text, :bold => Bold } @@ -685,7 +685,7 @@ class LastFmPlugin < Plugin } when :recenttracks tracks = doc.root.get_elements("recenttracks/track").map do |track| - [track.elements["artist"].text, track.elements["name"].text].join(" - ") + [track.elements["artist/name"].text, track.elements["name"].text].join(" - ") end counts = [] @@ -730,7 +730,7 @@ class LastFmPlugin < Plugin case action when :weeklytrackchart, :weeklyalbumchart format = "%{artist} - %{title} (%{bold}%{plays}%{bold})" - artist = item.elements["artist"].text + artist = item.elements["artist/name"].text when :weeklyartistchart, :topartists format = "%{artist} (%{bold}%{plays}%{bold})" artist = item.elements["name"].text |