Last active
August 29, 2015 14:02
-
-
Save sublimecoder/6ea8a42f3410ea482444 to your computer and use it in GitHub Desktop.
Testing Challenge
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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