Extracts information from parkrun results pages for inclusion in reports.
I occasionally volunteer as a Run Director at parkrun and produce an event report to celebrate achievements. I also write software occasionally to automate parts of my life. This is the confluence of these two interests.
If you volunteer at parkrun and produce an event report to celebrate achievements, this addon will make your life easier!
As soon as the latest results page loads for an event, you'll see a bunch of useful text before the results table is displayed, including:
- A summary of the number of finishers
- Any finishers who joined a milestone club
- Congratulations to new parkrunners
- A welcome to first-time visitors
- A celebration of personal bests
- A shout out to the walking and running clubs
- Cheers to our volunteers.
- A reminder to bring a barcode
- And a beautiful bunch of facts and figures
I wrote this for myself in an afternoon to see if I could do it and figured it
may be useful to others. I then spent a while over-engineering it in TypeScript
and adding some unit tests using jest
.
This project uses asdf to manage Node.js versions and corepack to manage pnpm. Here's how to set up your development environment:
# Install asdf (if you haven't already)
brew install asdf
# Add the NodeJS plugin
asdf plugin add nodejs
# Install NodeJS at the version specified in .tool-versions
asdf install
# Enable corepack (comes with NodeJS)
corepack enable
# Verify installations
node --version
pnpm --version
Once the tools are installed:
pnpm i # Install the development dependencies
pnpm t # Run unit tests
pnpm package # Package up all the things for Firefox and Chromium browsers
pnpm web-ext:lint # Verify package for Firefox
Or if Docker's more your thing:
docker buildx build . -o target
First, let's turn the TypeScript files into a single JavaScript file to be
consumed by web-ext
...
pnpm build --watch
...--watch
means we can edit the .ts
files and have our change reflected in
an instant.
Second, in another terminal, let's start up Firefox and see our code in action...
pnpm start
- Download this repository to a suitable location on your computer.
- In Firefox, navigate to "about:debugging#/runtime/this-firefox"
- Use the "Load Temporary Add-on..." button.
- Browse to and open the file
manifest.json
from the location where it was saved. - The add-on will now appear in the add-on manager’s list of installed add-ons and be ready to use
- Navigate to a results page such as https://www.parkrun.com.au/timboon/results/latestresults/.
Observe the additional details between the title and the event table.
This was built with Firefox in mind but also
works in Chromium-based browsers, using the chromium
artefacts. Enjoy!
Bug reports and pull requests are welcome on GitHub. Everyone interacting in the eventuate project's codebases, issue trackers, etcetera is expected to follow the code of conduct.
We use semantic commits in this project. Please see our contibution guidelines for more information about the preferred commit message format.
This project uses
semantic-release to
automate version management and package releases. The release process is
triggered automatically when changes are pushed to the main
branch.
The process will:
- Analyze commits to determine the next version number
- Update the CHANGELOG.md
- Create a new GitHub release
- Build and attach extension packages:
- Firefox extension (
.zip
) - Chrome extension (
.zip
) - Userscript (
.user.js
) - Bookmarklet installation page (
.html
)
- Firefox extension (
To test the release process locally:
GITHUB_TOKEN=your-token pnpm semantic-release --dry-run
The version number will be automatically incremented based on your commits:
fix:
→ patch (0.0.x)feat:
→ minor (0.x.0)BREAKING CHANGE:
→ major (x.0.0)
The addon is available as open source under the terms of the MIT License.