From 47eba1a679d626a94f811accf4a60a5eebc28498 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Wed, 26 Sep 2012 22:28:25 +0200 Subject: lastfm: match latest API changes Thanks Lite_ --- data/rbot/plugins/lastfm.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'data/rbot/plugins/lastfm.rb') 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 -- cgit v1.2.3