yesterday = datetime.datetime.today() - datetime.timedelta(days=1)
queryDate = yesterday.strftime("%Y%m%d")
- queryDate = queryDate + "00" #requires specifying hours
-
#handle -L
loglevel_mapping = { 'debug' : logging.DEBUG,
'info' : logging.INFO,
#2 Repeatedly call the API with that list of names
for a in articleList:
a = a.strip("\"\n") #destringify
- url= f"https://wikimedia.org/api/rest_v1/metrics/pageviews/per-article/en.wikipedia/all-access/all-agents/{a}/daily/{queryDate}/{queryDate}"
+ url= f"https://wikimedia.org/api/rest_v1/metrics/pageviews/per-article/en.wikipedia/all-access/all-agents/{a}/daily/{queryDate}00/{queryDate}00"
response = requests.get(url)
if response.ok:
-#!/usr/bin/env python3
+#!yusr/bin/env python3
###############################################################################
#
yesterday = datetime.datetime.today() - datetime.timedelta(days=1)
query_date = yesterday.strftime("%Y%m%d")
- query_data = query_date + "00" #requires specifying hours
-
#handle -L
loglevel_mapping = { 'debug' : logging.DEBUG,
'info' : logging.INFO,
logging.info(f"Last commit: {export_git_hash}")
json_output_filename = os.path.join(output_path, f"digobs_covid19-wikipedia-enwiki_revisions-{query_date}.json")
- tsv_output_filename = os.path.join(output_path, f"digobs_covid19-wikipedia-enwiki_revisions-{query_data}.tsv")
+ tsv_output_filename = os.path.join(output_path, f"digobs_covid19-wikipedia-enwiki_revisions-{query_date}.tsv")
api_session = api.Session("https://en.wikipedia.org/w/api.php")