Skip to content

Instantly share code, notes, and snippets.

@avgerin0s
Created December 4, 2012 22:20
Show Gist options
  • Save avgerin0s/4209462 to your computer and use it in GitHub Desktop.
Save avgerin0s/4209462 to your computer and use it in GitHub Desktop.
Json Parser
require 'json'
require 'rubygems'
require 'net/http'
require 'open-uri'
buf = open(ARGV[0], "UserAgent" => "Ruby-Wget").read
json = JSON.parse(buf)
puts "Name: " + json['name'] + "\nAge: " + json['age'] + "\nEmail: " + json['email']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment