Stephen's Janky Tour Pool Software
See an example of this in action here: http://stephenskory.com/TourPool2015/
This has only ever been used on a Linux machine. It's highly likely that it would be straightforward to get working on Mac OS X. On Windows, no idea!
- Python > 3.6
- PHP on your web server
- Python packages:
How To Get Started
- Download this repository using Mercurial, or by using the "Downloads" link on the left side of the page.
- In the file named "TdFpool.py", at the beginning of the Tour, edit content below
the lines that say
# --- EDIT BELOW HERE DAILY ---- #and
# --- EDIT HERE AT THE BEGINNING OF THE TOUR ---- #. Also, make sure that the very first line points to your location for Python 3.6 (or higher).
- At the beginning of the tour:
- add the teams in the order that they were drafted.
You can see the examples
that are already in the file. Note that the number just before the double close
))should increase by one for each entry. Also, the numbers start at 0.
- In the file
graph.gnuplot, update the stage descriptions (if desired), and update the names at the bottom to match the draft order.
- Also, if you like, you can update the LeTour link under the function named
printResultsLinksto the new year.
- Update the year values in
index.phpto the new year.
- add the teams in the order that they were drafted. You can see the examples that are already in the file. Note that the number just before the double close parentheses
- Daily, edit:
stageBonuses; Add a new line after every stage with the top three finishers. On TTT stages, enter 888 for all three values in order to not award any bonuses for those stages.
HTMLnames: Add a new entry to the list naming the content of the HTML source that was scraped (see below).
JerseyBonus: Update the six entries of this item to the current Green and Polka Dot jersey owners. The first three entires are for the Green jersey rankings, and the last three are for top three Polka Dot rankings.
dropped: Add a new entry after each stage. I find that it's simplest to add and empty list and then run the script (below) and see what riders have unpysically good times. They have most likely left the tour. You can re-run the script after updating
- You need to scrape some of the HTML off of the LeTour.fr website. Go to the
full overall classification and you can copy the needed HTML by following the
example in this video:
http://stephenskory.com/TourPool2015/2015-07-05_2111.swf (you may have to
download the file to your computer, and drag it to your browser, to play it).
The key is too look for the
code="ITG"tag. The content of the clipboard (which is what is captured with the "Copy" command) should be saved to a file in the same directory as the
TdFpool.pyscript. I typically name them by stage, so "01.html", "02.html", etc.
- To run everything, call
How to View
Just put all these files on a webserver, and point your browser to this location. If you have PHP working correctly, the results should just appear!
This code is some of my earliest Python code. It is not stellar nor stable. If I were to do this again, I'd do a much better job. But since this code isn't paying the bills, and it works as is, I haven't updated it.
Stephen Skory 5 July 2015