Created
December 4, 2013 08:15
-
-
Save yasyf/7783958 to your computer and use it in GitHub Desktop.
This file contains 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 | |
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