0

I retrieved all items from a job in Scrapinghub:

url = "https://storage.scrapinghub.com/items/#{job_id}?apikey=#{API_KEY}"
response = HTTParty.get(url)
items = response.parsed_response

The problem is that items is a String instead of a Hash. Is there a way to parse it as a Hash to easier retrieve single items as the response is JSON. If not, how do I best parse the string. Thanks

abc03
  • 13
  • 3
  • Looks to be already answered https://stackoverflow.com/questions/5410682/parsing-a-json-string-in-ruby – jmoney Dec 02 '18 at 19:28
  • I have tried it as well (parsed_response is the HTTParty way for JSON.parse) with the same result. – abc03 Dec 02 '18 at 19:35

0 Answers0