Created
September 1, 2016 00:39
-
-
Save mathiasbc/1d61fbb1ff21a06a66f1ae07ccf449f7 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/python3 | |
import requests | |
URL = "http://www.letsrevolutionizetesting.com/challenge.json" | |
def follow(url): | |
response = requests.get(url).json() | |
while 'follow' in response: | |
yield response | |
follow_url = response['follow'] | |
_id = follow_url.split('=')[-1] | |
response = requests.get(URL, params={'id': _id}).json() | |
def main(): | |
for r in follow(URL): | |
print(r) | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment