Lyndon Samson
1/5/2006 5:45:00 AM
On 1/5/06, jotto <jonathan.otto@gmail.com> wrote:
>
> Take Amazon's API for example, returning a XML file. In my application
> (I'm using Rails), I want to allow the user to specify a criteria,
> input it into a URL and send that URL to amazon to get the resulting
> XML file. My question is.... how in Ruby can I grab the XML and put it
> into a variable so I can parse it?
Heres a starter for .2 Note the use of a Proxy.
Net::HTTP::Proxy(phost, pport, puser, ppwd).start(host) {|http|
xmlStr = http.get(loc).body.to_s
}
}
REXML will let you parse the XML String into a DOM object for further
munging.