Skip to content

Instantly share code, notes, and snippets.

@hminaya
Last active December 16, 2015 05:18
Show Gist options
  • Save hminaya/5382961 to your computer and use it in GitHub Desktop.
Save hminaya/5382961 to your computer and use it in GitHub Desktop.
get JSON api with ruby
require "net/http"
require "json"
url = "http://www.emplea.do/jobs.json"
resp = Net::HTTP.get_response(URI.parse(url))
data = resp.body
@result = JSON.parse(data)
puts @result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment