Skip to content

Instantly share code, notes, and snippets.

@gourneau
Created November 18, 2012 05:01
Show Gist options
  • Select an option

  • Save gourneau/4103649 to your computer and use it in GitHub Desktop.

Select an option

Save gourneau/4103649 to your computer and use it in GitHub Desktop.
github jobsearch
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