]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/commitdiff
wow plugin: fix realm extraction xpath
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Wed, 6 Aug 2008 22:08:56 +0000 (00:08 +0200)
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Wed, 6 Aug 2008 22:08:56 +0000 (00:08 +0200)
data/rbot/plugins/wow.rb

index e1c7a4a4ee20ab6bab338272f52a91c5abb2f8c4..1350dd1a9d794efefe49402220f1afe50c25b3ea 100644 (file)
@@ -90,7 +90,7 @@ 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'],