Skip to content

Instantly share code, notes, and snippets.

@mathiasbc
Created September 1, 2016 00:39
Show Gist options
  • Save mathiasbc/1d61fbb1ff21a06a66f1ae07ccf449f7 to your computer and use it in GitHub Desktop.
Save mathiasbc/1d61fbb1ff21a06a66f1ae07ccf449f7 to your computer and use it in GitHub Desktop.
#!/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