summaryrefslogtreecommitdiff
path: root/fetch_data.py
diff options
context:
space:
mode:
authorMartin Fischer <martin@push-f.com>2022-06-25 01:10:09 +0200
committerMartin Fischer <martin@push-f.com>2022-06-25 01:12:29 +0200
commitbae65885a353e49fbb54a3310b6b5334d20e42ad (patch)
tree62a4e7fc3ca9ee77c0e808a3513ee130df57348b /fetch_data.py
parent7ed4d385fa6f2396cf0bf337db27674914c9aeb6 (diff)
move osm_base to edit summary
to avoid creating revisions if the data didn't change
Diffstat (limited to 'fetch_data.py')
-rwxr-xr-xfetch_data.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/fetch_data.py b/fetch_data.py
index a0753c4..aa3fa25 100755
--- a/fetch_data.py
+++ b/fetch_data.py
@@ -172,7 +172,6 @@ text = f'''\
-- This page is automatically generated by a Python script using the Overpass API.
-- {overpass_info['copyright']}
-- The wikidata_length data is queried from www.wikidata.org and available under Creative Commons CC0 License.
--- osm_base = {overpass_info['timestamp_osm_base']}
return ''' + luadata.serialize(
dict(relations=relations)
@@ -183,6 +182,12 @@ if args.update:
creds = tomli.load(f)
osmwiki.login(creds['username'], creds['password'])
csrf_token = osmwiki('query', meta='tokens')['query']['tokens']['csrftoken']
- osmwiki('edit', title='Module:Report/data', text=text, token=csrf_token)
+ osmwiki(
+ 'edit',
+ title='Module:Report/data',
+ text=text,
+ token=csrf_token,
+ summary=f"update (osm_base = {overpass_info['timestamp_osm_base']})",
+ )
else:
print(text)