Browse Source

Cleanup of web/update_plots.py

pull/97/head
Jure Šorn 3 years ago
parent
commit
940228a05b
1 changed files with 2 additions and 1 deletions
  1. 3
      web/update_plots.py

3
web/update_plots.py

@ -53,7 +53,8 @@ def update_confirmed_cases():
def scrape_yahoo(id_):
BASE_URL = 'https://query1.finance.yahoo.com/v7/finance/download/'
now = int(datetime.now().timestamp())
url = f'{BASE_URL}{id_}?period1=1579651200&period2={now}&interval=1d&events=history'
url = f'{BASE_URL}{id_}?period1=1579651200&period2={now}&interval=1d&' + \
'events=history'
return pd.read_csv(url, usecols=['Date', 'Close']).set_index('Date').Close
covid = pd.read_csv('https://covid.ourworldindata.org/data/owid-covid-data.csv',
usecols=['location', 'date', 'total_cases'])

Loading…
Cancel
Save