Skip to content

Instantly share code, notes, and snippets.

@sublimecoder
Last active August 29, 2015 14:02
Show Gist options
  • Save sublimecoder/6ea8a42f3410ea482444 to your computer and use it in GitHub Desktop.
Save sublimecoder/6ea8a42f3410ea482444 to your computer and use it in GitHub Desktop.
Testing Challenge
require 'rubygems'
require 'json'
require 'httpclient'
start = "http://letsrevolutionizetesting.com/challenge?format=json"
def go_to_url url
client = HTTPClient.new
httpresult = client.get_content(url)
JSON.parse(httpresult)
end
tmpResult = go_to_url start
while tmpResult["follow"]
tmpUrl = tmpResult["follow"] + '&format=json'
tmpResult = go_to_url tmpUrl
if tmpResult["follow"]
puts tmpResult["follow"]
else
puts tmpResult
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment