X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=data%2Frbot%2Fplugins%2Fwow.rb;h=8701c7672a2656df3d3923846bc1658ecf758059;hb=052217de30c59206d7025b582d4604557a747470;hp=e1c7a4a4ee20ab6bab338272f52a91c5abb2f8c4;hpb=c76d468894bbf617eaee2f1e8029194a2a1a27d5;p=user%2Fhenk%2Fcode%2Fruby%2Frbot.git diff --git a/data/rbot/plugins/wow.rb b/data/rbot/plugins/wow.rb index e1c7a4a4..8701c767 100644 --- a/data/rbot/plugins/wow.rb +++ b/data/rbot/plugins/wow.rb @@ -90,13 +90,14 @@ 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." end