Skip to content

Instantly share code, notes, and snippets.

@hellyeah
Forked from yasyf/check_sites.py
Created December 9, 2013 20:45
Show Gist options
  • Save hellyeah/7880526 to your computer and use it in GitHub Desktop.
Save hellyeah/7880526 to your computer and use it in GitHub Desktop.
import requests
sites = get_sites_from_db()
for s in sites:
try:
r = requests.head(s)
if r.status_code in [404,500]:
remove_site_from_db(s)
except Exception:
continue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment