About
parkrun Countries Visited shows country flag emojis for every country where a parkrunner has finished, on their all-results page (e.g. parkrunner A1179622).
How countries are inferred
The country is taken from the event link’s hostname (for example .com.au → Australia, .org.uk → United Kingdom, .co.nz → New Zealand). Domain suffixes do not always match political boundaries; a short disclaimer appears with the summary.
What you see
Flags beside each event in the results table, plus a #countries-visited summary under the parkrunner heading. Hover a flag for the country name and finish count.
Version 1.2.2 Updated
Screenshot
Install
Recommended: userscript. Bookmarklet works where a userscript manager isn’t available.
Userscript (recommended)
Install parkrun Countries Visited
First time? Userscript basics and installation steps
What is a userscript?
A userscript is a small piece of JavaScript that runs in your browser and enhances specific websites. These scripts work with parkrun event pages, parkrunner profile pages, and results pages, and can be used with any userscript manager including Userscripts, Tampermonkey, Violentmonkey, or any compatible browser extension.
Installation steps
-
Install a userscript manager for your browser:
- Desktop: Userscripts (Safari), Tampermonkey (Chrome, Firefox, Edge, Opera), or Violentmonkey (Orion)
- iOS: Userscripts (Safari) or Violentmonkey (Orion)
- Android: Install Kiwi Browser, then install Tampermonkey or Violentmonkey from the Chrome Web Store.
- Click the Install button above for this script.
- Click “Install” when prompted by your userscript manager.
Bookmarklet
A bookmarklet is a bookmark whose URL is JavaScript. Use it on browsers that support bookmarks but not userscript managers.
Drag this link to your bookmarks bar:
parkrun Countries Visited bookmarklet
Mobile bookmarklet setup and full code
Mobile bookmarklet
On mobile browsers that let you edit bookmark URLs:
- Copy the JavaScript code below to your clipboard.
- Create a new bookmark for any page.
- Edit the bookmark and replace its URL with the code you copied.
- Navigate to the relevant parkrun page.
- Select the bookmark to run the script.
javascript:function _slicedToArray(e,a){return _arrayWithHoles(e)||_iterableToArrayLimit(e,a)||_unsupportedIterableToArray(e,a)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,a){var n;if(e)return"string"==typeof e?_arrayLikeToArray(e,a):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,a):void 0}function _arrayLikeToArray(e,a){(null==a||a>e.length)&&(a=e.length);for(var n=0,t=Array(a);n<a;n++)t[n]=e[n];return t}function _iterableToArrayLimit(e,a){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var t,r,l,o,i=[],u=!0,c=!1;try{if(l=(n=n.call(e)).next,0===a){if(Object(n)!==n)return;u=!1}else for(;!(u=(t=l.call(n)).done)&&(i.push(t.value),i.length!==a);u=!0);}catch(e){c=!0,r=e}finally{try{if(!u&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw r}}return i}}function _arrayWithHoles(e){if(Array.isArray(e))return e}(()=>{var e,a,r,n,t,l={at:{flag:"🇦🇹",name:"Austria"},ru:{flag:"🇷🇺",name:"Russia"},au:{flag:"🇦🇺",name:"Australia"},ca:{flag:"🇨🇦",name:"Canada"},com:{flag:"🇺🇸",name:"United States"},de:{flag:"🇩🇪",name:"Germany"},dk:{flag:"🇩🇰",name:"Denmark"},fi:{flag:"🇫🇮",name:"Finland"},fr:{flag:"🇫🇷",name:"France"},ie:{flag:"🇮🇪",name:"Ireland"},is:{flag:"🇮🇸",name:"Iceland"},it:{flag:"🇮🇹",name:"Italy"},jp:{flag:"🇯🇵",name:"Japan"},lt:{flag:"🇱🇹",name:"Lithuania"},my:{flag:"🇲🇾",name:"Malaysia"},nl:{flag:"🇳🇱",name:"Netherlands"},no:{flag:"🇳🇴",name:"Norway"},nz:{flag:"🇳🇿",name:"New Zealand"},pl:{flag:"🇵🇱",name:"Poland"},se:{flag:"🇸🇪",name:"Sweden"},sg:{flag:"🇸🇬",name:"Singapore"},uk:{flag:"🇬🇧",name:"United Kingdom"},us:{flag:"🇺🇸",name:"United States "},za:{flag:"🇿🇦",name:"South Africa"}};function o(e){var e=e.hostname.split("."),a=e[e.length-1];return a="com"===a&&2===e[0].length?e[0]:a}"undefined"!=typeof module&&module.exports?module.exports={getCountryCodeFromUrl:o}:(t=(t=document.querySelectorAll("#results"))[t.length-1])?(t.querySelectorAll("tr").forEach(function(e){var a,n,e=e.querySelector('td a[href*="parkrun"]');e&&(a=o(new URL(e.href)),a=l[a])&&((n=document.createElement("span")).textContent=" ".concat(a.flag),n.title=a.name,n.style.cursor="help",e.appendChild(n))}),t=t,n=new Map,t.querySelectorAll("tr").forEach(function(e){var e=e.querySelector('td a[href*="parkrun"]');e&&(e=o(new URL(e.href)),n.set(e,(n.get(e)||0)+1))}),(t=t=Array.from(n.entries()).sort(function(e,a){var n=(null==(n=l[e[0]])?void 0:n.name)||e[0],e=(null==(e=l[a[0]])?void 0:e.name)||a[0];return n.localeCompare(e)}).map(function(e){var e=_slicedToArray(e,2),a=e[0],e=e[1],n=l[a];return{symbol:n?n.flag:a,name:n?n.name:a.toUpperCase(),count:e}})).length?(e=document.querySelector("h2"))?((a=document.createElement("div")).id="countries-visited",a.style.marginLeft="10px",a.style.fontSize="1.8em",a.style.marginTop="5px",a.title="".concat(t.length," Countries visited, according to parkrun's domains. Political boundaries may not be accurate."),(r=document.createElement("span")).style.lineHeight="1.5",r.style.display="inline-block",t.forEach(function(e){var a=e.symbol,n=e.name,e=e.count,t=document.createElement("span");t.textContent=a,t.title="".concat(n," (").concat(e,")"),t.style.cursor="help",r.appendChild(t),r.appendChild(document.createTextNode(" "))}),a.appendChild(r),e.appendChild(a)):console.log("No title"):console.log("No countries visited")):console.log("Results table not found")})();