Skip to content

Instantly share code, notes, and snippets.

@dustMason
Created December 28, 2013 05:50
Show Gist options
  • Save dustMason/8156464 to your computer and use it in GitHub Desktop.
Save dustMason/8156464 to your computer and use it in GitHub Desktop.
require 'net/http'
require 'json'
require 'uri'
uri = URI.parse "http://www.letsrevolutionizetesting.com/challenge.json"
loop do
response = JSON.parse(Net::HTTP.get_response(uri).body)
puts response
break unless response["follow"]
new_uri = URI.parse response["follow"]
new_id = URI.decode_www_form(new_uri.query).assoc("id").last
uri.query = "id=#{new_id}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment