Skip to content

Commit 513fac4

Browse files
committed
Switch entry dates source, closes #32
1 parent 52245a1 commit 513fac4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/python/paperetl/cord19/entry.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
from urllib.request import urlretrieve
1313

1414
import pandas as pd
15+
import requests
1516

1617
from .execute import Execute
1718

@@ -40,8 +41,9 @@ def download(maxdate):
4041
if not os.path.exists(DIRECTORY):
4142
os.mkdir(DIRECTORY)
4243

43-
# Read list of dates from AI2 CORD-19 Releases page
44-
dates = pd.read_html("%s/historical_releases.html" % URL)[0]["Date"].tolist()
44+
# Read list of dates from AI2 CORD-19 page
45+
changelog = requests.get("%s/latest/changelog" % URL)
46+
dates = [line for line in changelog.text.splitlines() if re.match(r"\d{4}\-\d{2}\-\d{2}", line)]
4547

4648
# Sort dates
4749
dates = sorted(dates)

0 commit comments

Comments
 (0)