Created
July 7, 2023 03:26
-
-
Save gerryhd/074426e7b5e5cb4120ecdcf3f7bdcfdd to your computer and use it in GitHub Desktop.
funny_challenge.rb
This file contains hidden or 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 'rest-client' | |
require 'json' | |
HEADERS = { accept: :json } | |
response = RestClient.get('https://www.letsrevolutionizetesting.com/challenge', HEADERS) | |
response = JSON.parse(response.body, symbolize_names: true) | |
while response.keys.include? :follow | |
response = RestClient.get(response[:follow], HEADERS) | |
response = JSON.parse(response.body, symbolize_names: true) | |
puts response | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment