Created
June 1, 2024 20:00
-
-
Save eliasdabbas/56484c7b8aefd638f2389fda4e687a71 to your computer and use it in GitHub Desktop.
Setting up a daily status code checker
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 datetime | |
import advertools as adv | |
today = datetime.datetime.now(datetime.UTC).strftime("%Y_%m_%d") | |
sitemap = adv.sitemap_to_df("https://example/sitemap.xml") | |
adv.crawl_headers( | |
sitemap["loc"], | |
f"path/to/status_codes/{today}.jl", | |
custom_settings={ | |
"AUTOTHROTTLE_ENABLED": False, | |
"LOG_FILE": f"path/to/status_codes_logs/{today}.jl", | |
}, | |
) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this chron task. You can change @daily to @Weekly or @monthly