Skip to content

Instantly share code, notes, and snippets.

@hschne
Created August 28, 2023 18:52
Show Gist options
  • Save hschne/29924f5591c74488b56dd2fefa3ea0cc to your computer and use it in GitHub Desktop.
Save hschne/29924f5591c74488b56dd2fefa3ea0cc to your computer and use it in GitHub Desktop.
It Follows...
require 'httparty'
def fetch(url)
response = HTTParty.get(url)
response.parsed_response
end
# Setting content type didn't work 😢
def to_json_request(url)
url.gsub('challenge', 'challenge.json')
end
url = 'https://www.letsrevolutionizetesting.com/challenge.json'
response = fetch(url)
follow = to_json_request(response['follow'])
while follow
response = fetch(follow)
puts response
if response['follow']
follow = to_json_request(response['follow'])
else
follow = nil
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment