Skip to content

Instantly share code, notes, and snippets.

@skatkov
Created January 7, 2015 10:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save skatkov/4ab15b93d4924200c5d9 to your computer and use it in GitHub Desktop.
Save skatkov/4ab15b93d4924200c5d9 to your computer and use it in GitHub Desktop.
testing revolution :)
import requests
def visit(d):
print "Visit: %s" % d.url
if 'follow' in d.json():
visit(requests.get(next_link(d)))
else:
print d.text
def next_link(d):
follow_link = d.json().get('follow')
return "http://www.letsrevolutionizetesting.com/challenge.json?id=" + follow_link.split("=")[-1]
if __name__ == "__main__":
url = "http://www.letsrevolutionizetesting.com/challenge.json"
visit(requests.get(url))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment