Class: WarcraftArmory::Utils::Parser

Inherits:
Object
  • Object
show all
Defined in:
lib/warcraft_armory/utils/parser.rb

Overview

:nodoc:

Constant Summary collapse

USER_AGENT =

We need to call with a FireFox user-agent, which makes the armory spit out XML instead of HTML.

'Mozilla/5.0 (Windows; U; Windows NT 5.0; en-GB; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4'

Class Method Summary collapse

Class Method Details

.parse_url(url) ⇒ Object

Open the url and return the data retrieved as a String



10
11
12
# File 'lib/warcraft_armory/utils/parser.rb', line 10

def self.parse_url(url)
  Hpricot.XML(open(url, "User-Agent" => USER_AGENT))      
end