My current whereabouts.
A web interface to display a map of locations generated by the somewhere command-line tool.
Available at https://location.dylanpyle.com
The update-location script is run hourly via a cron job on my primary machine.
The map is rendered with MapKit JS and needs a token (requires an Apple Developer Program membership):
- In the developer portal, create a Maps ID (Certificates, Identifiers & Profiles → Identifiers) and a private key with MapKit JS enabled (→ Keys).
- Generate a token at
maps.developer.apple.com using that key,
with the origin restricted to
location.dylanpyle.com. - Paste it into
MAPKIT_TOKENSinlocation.js.
Tokens restricted to a domain never expire, and don't work from any other site, so they're fine to commit. (Tokens without a restriction expire after 7 days.)
Apple's token generator won't accept localhost, so local development uses a
made-up domain instead:
-
Generate a second token restricted to
location.testand paste it intoMAPKIT_TOKENSalongside the production one. -
Point the domain at your machine:
echo "127.0.0.1 location.test" | sudo tee -a /etc/hosts -
Serve the directory with any static server, e.g.
python3 -m http.server, and open http://location.test:8000
Inspired by Hundred Rabbits
MIT