Commit | Commit message | Age | Author | Refs | ||
---|---|---|---|---|---|---|
r23:091a5623a927
|
|
0 | ||||
r22:069f5622edc4
|
|
0 | ||||
r21:c22a7c8a19ac
|
|
0 | ||||
r20:af083c55811c
|
|
0 | ||||
r19:f7e8cfc91e59
|
|
0 | ||||
r18:72f7fd5117f5
|
|
0 | ||||
r17:327326bf193c
|
|
0 | ||||
r16:066f14dc6dc6
|
|
0 | ||||
r15:5cfd5305f9ff
|
|
0 | ||||
r14:e1b440e787c7
|
|
0 |
Stephen's Janky Tour Pool Software
See an example of this in action here: http://stephenskory.com/TourPool2015/
Requirements
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:
- BeautifulSoup4
- Numpy
- Plotly
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
parentheses))
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
printResultsLinks
to the new year. - Update the year values in
index.php
to the new year.
- add the teams in the order that they were drafted.
- 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
updatingdropped
.- 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 theTdFpool.py
script. I typically name them by stage,
so "01.html", "02.html", etc. - To run everything, call
./TdFPool.py
.
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!
Comments
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