Created
April 22, 2020 21:37
-
-
Save simcard0000/ae37c54c65418a00b4dcfcf4eb3f7c49 to your computer and use it in GitHub Desktop.
π Quick script to download Covid-19 data every morning
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 | |
import os | |
import shutil | |
import datetime | |
while 1: | |
#check what time it is | |
curr_date = str(datetime.datetime.today()) | |
curr_hour = curr_date[11:13] | |
curr_min = curr_date[14:16] | |
curr_sec = curr_date[17:19] | |
if curr_hour == '09' and curr_min == '00' and curr_sec == '00': | |
#file type: xlsx | |
url = 'https://www.ecdc.europa.eu/sites/default/files/documents/COVID-19-geographic-disbtribution-worldwide.xlsx' | |
req = requests.get(url, allow_redirects=True) | |
open('cases.xlsx', 'wb').write(req.content) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment