Created
December 17, 2013 23:23
-
-
Save rottmanj/8014603 to your computer and use it in GitHub Desktop.
letsrevolutionizetesting.com challenge script
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 'open-uri' | |
require 'JSON' | |
url = "http://www.letsrevolutionizetesting.com/challenge" | |
i_am_the_winner = false | |
until i_am_the_winner do | |
json = JSON.parse(open(url, "Accept" => "application/json").read) | |
if json.has_key?("follow") | |
url = json["follow"] | |
puts "Not a winner yet. Trying URL: #{url}" | |
else | |
puts "You won!!! \n\n #{json}" | |
i_am_the_winner = true | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment