Created
November 18, 2012 05:01
-
-
Save gourneau/4103649 to your computer and use it in GitHub Desktop.
github jobsearch
This file contains hidden or 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
| import requests | |
| import json | |
| search = "https://jobs.github.com/positions.json?description=python&location=San+Francisco" | |
| attempts = 100 | |
| worked = 0 | |
| for count, attempt in enumerate(xrange(attempts)): | |
| print "Attempt", count, | |
| r = requests.get(search) | |
| if r.json: | |
| worked += 1 | |
| print "worked" | |
| else: | |
| print "failed" | |
| print "The serach worked", worked, "out of", attempts, "attempts" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment