From: Lyndon Samson Date: 2006-01-05T14:45:22+09:00 Subject: Re: Pulling XML from Amazon API ------=_Part_46073_27916843.1136439909371 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On 1/5/06, jotto 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 =3D http.get(loc).body.to_s } } REXML will let you parse the XML String into a DOM object for further munging. ------=_Part_46073_27916843.1136439909371--