This is my first time working with REST and XML. My goal is to access
Google’s geocoding service using HTTP. Here’s the code I have so far:
address = ‘q=1600 Amphitheatre Parkway Mountin View,CA’
address1 = URI.escape(address)
googleoutput = ‘&output=xml’
googlekey = ‘&key=mykey’
doc = Document.new result
@googlresult = r.attributes[“coordinates”]
It works up till this line doc = Document.new result (I’m using IRB to
test this BTW)
It says undefined when that line is executed. Having never done this
before, I don’t know what the issue is. I also know there is a
google-geocode gem but I’m trying to understand this so I can customize
it a little.
Here’s a sample of the XML output:
I need to get the status code and the coordinates.
Any help is greatly appreciated.