X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=data%2Frbot%2Fplugins%2Fwow.rb;h=8701c7672a2656df3d3923846bc1658ecf758059;hb=052217de30c59206d7025b582d4604557a747470;hp=caf3925bfe8b7db76fc6078eaaaf2d35142a425b;hpb=c55aef76a4298c70667ebe932c579ec2497ee191;p=user%2Fhenk%2Fcode%2Fruby%2Frbot.git diff --git a/data/rbot/plugins/wow.rb b/data/rbot/plugins/wow.rb index caf3925b..8701c767 100644 --- a/data/rbot/plugins/wow.rb +++ b/data/rbot/plugins/wow.rb @@ -90,18 +90,19 @@ class RealmPlugin < Plugin xmldoc = @bot.httputil.get("http://www.worldofwarcraft.com/realmstatus/status.xml", :cache => false) raise "unable to retrieve realm status" unless xmldoc realm_list = (REXML::Document.new xmldoc).root - realm_data = realm_list.elements["r[@n=\"#{realm_name}\"]"] + realm_data = realm_list.get_elements("//r[@n=\"#{realm_name}\"]").first if realm_data and realm_data.attributes.any? then realm = Realm.new( realm_data.attributes['n'], realm_data.attributes['s'].to_i, realm_data.attributes['t'].to_i, realm_data.attributes['l'].to_i) + realm.to_s else - "Realm, #{realm_name}, not found." + "realm #{realm_name} not found." end rescue => err - "Error retrieving realm status: #{err}" + "error retrieving realm status: #{err}" end end def realm(m,params)