Take a unique ID for maps.

I want to be able to share this without giving away my data.

The page takes a query parameter map=<ID>, which says which data file to load.

If you load the page without a map ID, it makes up a random 8-digit hex string and uses that.

The no-selection view shows a link to the map.
This commit is contained in:
Christian Lawson-Perfect 2025-02-10 11:52:12 +00:00
parent 5d69d2cad7
commit fe963ec2db
6 changed files with 67 additions and 28 deletions

View file

@ -10,8 +10,9 @@ form = cgi.FieldStorage()
print('Content-Type: text/plain\n')
content = form.getfirst('content')
map_id = form.getfirst('map_id')
with open(Path('..') / 'data' / 'markers.json', 'w') as f:
with open(Path('..') / 'data' / f'markers-{map_id}.json', 'w') as f:
f.write(content)
print(content)