summaryrefslogtreecommitdiff
path: root/data/rbot/plugins/lastfm.rb
diff options
context:
space:
mode:
Diffstat (limited to 'data/rbot/plugins/lastfm.rb')
-rw-r--r--data/rbot/plugins/lastfm.rb13
1 files changed, 7 insertions, 6 deletions
diff --git a/data/rbot/plugins/lastfm.rb b/data/rbot/plugins/lastfm.rb
index 96bdaa48..f9fb1fd3 100644
--- a/data/rbot/plugins/lastfm.rb
+++ b/data/rbot/plugins/lastfm.rb
@@ -158,15 +158,16 @@ class LastFmPlugin < Plugin
m.reply _("last.fm parsing failed")
return
end
- if xml.class == Net::HTTPInternalServerError
+ if xml.class == Net::HTTPBadRequest
if doc.root.elements["error"].attributes["code"] == "7" then
error = doc.root.elements["error"].text
error.match(/Invalid username: \[(.*)\]/);
- if @registry.has_key? $1 and not params[:recurs]
- if user1 == $1
- params[:user1] = @registry[ $1 ]
- elsif user2 == $1
- params[:user2] = @registry[ $1 ]
+ baduser = $1
+ if @registry.has_key? baduser and not params[:recurs]
+ if user1 == baduser
+ params[:user1] = @registry[baduser]
+ elsif user2 == baduser
+ params[:user2] = @registry[baduser]
end
params[:recurs] = true
tasteometer(m, params)