diff options
-rwxr-xr-x | osm_proposals/proposals.py | 3 | ||||
-rw-r--r-- | static/script.js | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/osm_proposals/proposals.py b/osm_proposals/proposals.py index e265fcc..5431e96 100755 --- a/osm_proposals/proposals.py +++ b/osm_proposals/proposals.py @@ -4,6 +4,7 @@ import argparse import html import json import sys +import time import logging from collections.abc import Container @@ -31,7 +32,7 @@ def run(): proposals = find_proposals() with open(args.out_file, 'w') as f: - json.dump(proposals, f) + json.dump({"last_updated": int(time.time()), "proposals": proposals}, f) logger.info(f"updated {args.out_file}") diff --git a/static/script.js b/static/script.js index 35aa43e..20fb377 100644 --- a/static/script.js +++ b/static/script.js @@ -93,7 +93,7 @@ function debounce(callback, wait) { } (async function() { - const proposals = await (await fetch('proposals.json')).json(); + const { proposals } = await (await fetch('proposals.json')).json(); const params = new URLSearchParams(location.search); nameInput.value = params.get('q'); |