Created
August 28, 2023 18:52
-
-
Save hschne/29924f5591c74488b56dd2fefa3ea0cc to your computer and use it in GitHub Desktop.
It Follows...
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 '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