Skip to content

Instantly share code, notes, and snippets.

@jackdempsey
Created July 23, 2008 02:52
Show Gist options
  • Save jackdempsey/1489 to your computer and use it in GitHub Desktop.
Save jackdempsey/1489 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require 'net/http'
require 'uri'
require 'rubygems'
require 'json'
require 'pp'
url = 'http://www.apple.com/retail/iphone/feeds/3g_us_inv.json'
json = Net::HTTP.get_response(URI.parse(url)).body
feed = JSON.parse(json)
feed['locations']['VA'].each do |location|
next if location['available']['black16'] == false
p location['city']
p location['name']
p location['available']
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment