I have been trying for two days to figure this out and can't get what I am doing wrong. I have been working with APIs for a while now, but this is the first time I have tried it with Ruby.
Currently this what I have:
require 'httparty'
response = URI.parse('http://api.remix.bestbuy.com/v1/stores(area(55423,20))?apiKey=xxxxxxxxxxxxxx')
parse = CGI.parse(response.query)
result = parse['id'].first
$result = result
I plan to move $result to result.html.erb to iterate into a table, but not sure if I have the parsing done correctly, since I can't view the contents of reponse or $result. Any idea if I am even close? and how to iterate through the xml after..
response.body
instead ofresponse.query
? – Uri Agassi Nov 13 '14 at 7:12doc = Nokogiri::HTML(open("http://www.threescompany.com/"))
– Uri Agassi Nov 13 '14 at 7:35