X-Git-Url: https://code.communitydata.science/covid19.git/blobdiff_plain/13371fd83edfd11d7c9051fe1e69e92b4204fc3b..152704df7c0e74b51660c003d90373c4dc343eb1:/wikipedia/scripts/fetch_enwiki_daily_views.py diff --git a/wikipedia/scripts/fetch_enwiki_daily_views.py b/wikipedia/scripts/fetch_enwiki_daily_views.py index 829343d..9f147e0 100755 --- a/wikipedia/scripts/fetch_enwiki_daily_views.py +++ b/wikipedia/scripts/fetch_enwiki_daily_views.py @@ -58,8 +58,8 @@ def main(): logging.info(f"Last commit: {digobs.git_hash()}") #1 Load up the list of article names - j_outfilename = os.path.join(outputPath, f"digobs_covid19-wikipedia-enwiki_dailyviews-{export_date}.json") - t_outfilename = os.path.join(outputPath, f"digobs_covid19-wikipedia-enwiki_dailyviews-{export_date}.tsv") + j_outfilename = os.path.join(outputPath, f"digobs_covid19-wikipedia-enwiki_dailyviews-{query_date}.json") + t_outfilename = os.path.join(outputPath, f"digobs_covid19-wikipedia-enwiki_dailyviews-{query_date}.tsv") with open(articleFile, 'r') as infile: articleList = list(map(str.strip, infile)) @@ -82,6 +82,7 @@ def main(): else: failure = failure + 1 logging.warning(f"Failure: {response.status_code} from {url}") + continue # start writing the CSV File if it doesn't exist yet try: