Skip to content

Instantly share code, notes, and snippets.

@gerryhd
Created July 7, 2023 03:26
Show Gist options
  • Save gerryhd/074426e7b5e5cb4120ecdcf3f7bdcfdd to your computer and use it in GitHub Desktop.
Save gerryhd/074426e7b5e5cb4120ecdcf3f7bdcfdd to your computer and use it in GitHub Desktop.
funny_challenge.rb
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