parkrun Events Map hack
A bookmarklet
Version 3.2, 29 September 2024
Ian Shepherd A392280
This is
obviously completely unofficial, not endorsed by parkrun etc. This was originally an academic exercise for personal use, but I was asked by a couple of people to make it
available. It's handy for parkrun tourists, modifying the parkrun events map to show which events
you (or anyone else you like) have visited.
Scroll down for instructions, or first see what's new in this version...
Changelog:
- [v3.2] A really minor fix for a bug introduced by parkrun results page URLs gaining a trailing slash in the last week or two
- [v3.1] A list of completed events that have since been discontinued can now be viewed by clicking the text "of which x no longer exist"
- [v3.1] Some minor code tweaks to reflect layout and URL changes on parkrun websites
- [v3.0] Major reworking to make compatible with the updated parkrun map, which uses Mapbox instead of Google Maps. Please note some older features are no longer included, as they now have native equivalents, such as event name labelling
- [v3.0] Results caching to reduce demand on parkrun server and improve performance; after all, any athlete's results will typically only change once a week. To get a fresh copy, Ctrl+click the button or click the refresh link above the map
- [v3.0] Cow icons! Visited parkruns are now denoted by the very recognisable cow icon, designed by Kathy Brown for the UK parkrun tourists Facebook group
- [v2.7] Event names are now shown in tooltips when hovering over markers
- [v2.7] Added Link Preview option: when ticked, clicking a marker shows a popup with the event name instead of opening the event website. Click the popup to go to the site! (Great for mobile)
- [v2.7] Added link to this page and current version number
- [v2.7] Fixed that bloody Firefox bug again! (seems it gets reintroduced by the minifier, so I have to remember to intervene)
- [v2.6] incorporated tweaks introduced by parkrun website facelift on 12 June 2019, restoring functionality
- [v2.6] amended filters used to improve contrast between "done" (now green with drop shadow) and "to do" (now semi-transparent)
- [v2.5] thanks to a bug report from Graham Smith, now gracefully handles cases of "athlete not found" and athletes that have run no parkruns
- [v2.5] improved validation of athlete number, with visual feedback of invalid input. Also, now accepts numbers with or without initial A
- [v2.5] now checks for previous initialization, so multiple bookmark clicks no longer add multiple interfaces
- [v2.4] Fixed bug in fussy Firefox that was causing blank screen with [Object object] displayed in top corner
- [v2.4] Fixed bug that stopped data loading on non-UK parkrun websites due to CORS
- [v2.4] Fixed regression bug when cookies/LocalStorage disabled
- [v2.4] Added a check to reattempt map initialization if it didn't work on page load - seems to make the map work in Chrome for Android!!!
- [v2.3] Updated links to reflect parkrun site finally supporting https (well done!)
- [v2.3] Athlete ID and zoom-to-fit preference is now remembered. Athlete history is loaded automatically if an ID is saved
- [v2.3] Athlete ID box and button are disabled with a "Please wait..." message while processing, indicating that something is happening
- [v2.2] Added full-screen control (may not work exiting full screen, but try pressing Esc instead)
- [v2.1] Added "Zoom to fit" checkbox; if ticked, map will zoom to show all green markers
- [v2.0] works with the updated version of the parkrun events map, since they moved from Google Maps to OpenStreetMap
- [v2.0] now works with all 5k events worldwide
- [v2.0] turns the markers for visited events green instead of using the junior parkrun icon
- [v2.0] moves the visited markers up above the rest to make them easier to see in a clump
- [v2.0] no longer any need to press the button again after zooming (which means only one scrape per athlete)
- [v2.0] can press enter after entering an athlete number instead of having to click the button
- [v2.0] retains the original small/large icons depending on zoom level
- [v2.0] confirms which runner's data you're looking at under the athlete number box
- [v2.0] shows how many different events have been run, as well as how many of those don't exist any more, taking care to exclude junior events
- [v1.0] original, crude version, which worked with Google Maps and used a junior parkrun icon to differentiate which 5k events had been run
Instructions:
- Either: Drag this button to your bookmarks bar above: Events map hack v3.2
- Or: If you're on a mobile, try long-pressing the button above. On Firefox, for example, you should get a "Bookmark link" option. On Chrome, you can at least "Copy link address" in order to create the bookmark manually, as follows
- Or: Manually create a new bookmark, call it "Events map hack" or whatever you like, and paste the code below into the URL field
- Go to the parkrun events map
- On desktop:After the map has loaded, click your new bookmark
- On mobile:After the map has loaded, click in the address bar and type a few letters of your bookmark name, e.g. "hack". When you see it in the list below, click it. Note that it doesn't work if you go via your browser's Bookmarks function!
- Enter a barcode number in the new box that has appeared above the map and press Enter or click the button
- After a moment or two, all events visited by that athlete should be highlighted with cow icons in yellow circles
This is provided for free, no warranties etc... let me know if you have any issues and I'll see what I can do. If you would like to buy me a beer or something, you can
- it would be most appreciated! :-)