prefers

This is prefers

Generate a draft event report based on a parkrun’s results page

WHAT DOES IT DO?

prefers tries to give the user a head start on writing a parkrun event report by collating some names and numbers from an event’s weekly results sheet.

For example, it can compile lists of:

It also gathers some fun stuff about participant finish times and their placings, including:

NO SUPPORT

OK, the disclaimers and stuff:

HOW DOES IT WORK?

Save a copy of the event’s results sheet, that is the page at https://www.parkrun.com/EVENT-NAME/results/latestresults/
In a browser choose: File → Save Page As… "Web Page, HTML only".

Then pass the path to the saved file as input to this script or start the app and select it using the dialog box.

If an input file is passed on the command line, prefers works on that file without any further interaction. Otherwise the user will be shown the dialog box.

A draft of the report will be saved in an HTML file alongside the original file. A unique name is generated based on the input file name or you can specify an output file name.

[Linux only] A Microsoft Word (.docx) file is also generated, if Libre Office or Open Office is available on the system.

prefers has a built-in report template but an alternative template file can be used. See --help-templates or right-click on the info button to find out more.

LIMITATIONS

prefers does not ‘understand’ the results sheet at all, it just looks for known patterns and extracts the corresponing text. If parkrun ever changes the format of the results page, prefers will break.

Don’t attempt to scrape the results page directly from the web—it won’t work. prefers will only read from a local file.

Also, passing input other than a parkrun results page will probably cause the program to hang. See comment above about stability and fitness for purpose.

DOWNLOAD

No installation, just run prefers.

Version 2022.09.16:

Other than the output draft report files, prefers does not write anything to the host system.