This is a simple snippet to show how to work with json and ruby. This code is really messy. Sorry
- Refactor this code.
- Refactoring is welcome.
require 'json' | |
require 'net/http' | |
require 'uri' | |
url = 'awesome_url.json' | |
uri = URI.parse(url) | |
http = Net::HTTP.new(uri.host, uri.port) | |
json_file = http.get(url) | |
#puts json_file.body | |
puts jj JSON.parse(json_file.body) |