gcp-hockey-results/templates/_about.html
Jonny Ervine 1ffa319b1e new file: app.py
new file:   appengine_config.py
	new file:   dbWrite.py
	new file:   forms.py
	new file:   main.py
	new file:   readSettings.py
	new file:   requirements.txt
	new file:   routes/__init__.py
	new file:   routes/_convenor.py
	new file:   routes/_hkfcD_motm.py
	new file:   routes/_matches.py
	new file:   routes/_search.py
	new file:   routes/dashboard.py
	new file:   static/css/bootstrap-theme.css
	new file:   static/css/bootstrap-theme.css.map
	new file:   static/css/bootstrap-theme.min.css
	new file:   static/css/bootstrap-theme.min.css.map
	new file:   static/css/bootstrap.css
	new file:   static/css/bootstrap.css.map
	new file:   static/css/bootstrap.min.css
	new file:   static/css/bootstrap.min.css.map
	new file:   static/css/dashboard.css
	new file:   static/css/dashboard.css.orig
	new file:   static/fonts/glyphicons-halflings-regular.eot
	new file:   static/fonts/glyphicons-halflings-regular.svg
	new file:   static/fonts/glyphicons-halflings-regular.ttf
	new file:   static/fonts/glyphicons-halflings-regular.woff
	new file:   static/fonts/glyphicons-halflings-regular.woff2
	new file:   static/js/bootstrap.js
	new file:   static/js/bootstrap.min.js
	new file:   static/js/dashboard.js
	new file:   static/js/npm.js
	new file:   tables.py
	new file:   templates/_about.html
	new file:   templates/_clubPlayingRecordResults.html
	new file:   templates/_clubPlayingRecords.html
	new file:   templates/_convenorClubAdd.html
	new file:   templates/_convenorClubAddResults.html
	new file:   templates/_convenorClubList.html
	new file:   templates/_convenorEditPlayerResults.html
	new file:   templates/_convenorEditSquadList.html
	new file:   templates/_convenorEditSquadListTeamSelect.html
	new file:   templates/_convenorFixtureList.html
	new file:   templates/_convenorPlayerAdd.html
	new file:   templates/_convenorPlayerAddResults.html
	new file:   templates/_convenorPlayerDbCreate.html
	new file:   templates/_convenorPlayerDbCreateResults.html
	new file:   templates/_convenorPlayerEdit.html
	new file:   templates/_convenorSquadList.html
	new file:   templates/_convenorSquadListResults.html
	new file:   templates/_convenorTeamAdd.html
	new file:   templates/_convenorTeamAddResults.html
	new file:   templates/_error.html
	new file:   templates/_goalsAssistsAdmin.html
	new file:   templates/_hkfcDAdminThanks.html
	new file:   templates/_hkfcDGoalsThanks.html
	new file:   templates/_hkfcDMatchComments.html
	new file:   templates/_hkfcDMatchSquad.html
	new file:   templates/_hkfcDMatchSquadReset.html
	new file:   templates/_hkfcDMatchSquadSelected.html
	new file:   templates/_hkfcDMotmAdmin.html
	new file:   templates/_hkfcDMotmVote.html
	new file:   templates/_hkfcDPlayerRemoved.html
	new file:   templates/_hkfcDPotYChart.html
	new file:   templates/_hkfcDVoteChart.html
	new file:   templates/_hkfcDVoteThanks.html
	new file:   templates/_hkfcPlayerDeleted.html
	new file:   templates/_matchDetails.html
	new file:   templates/_playerCheck.html
	new file:   templates/_playerCheckResults.html
	new file:   templates/_playerRecordResults.html
	new file:   templates/_playerRecords.html
	new file:   templates/_search.html
	new file:   templates/_searchResults.html
	new file:   templates/_teamRecordResults.html
	new file:   templates/_teamRecords.html
	new file:   templates/dashboard.html
	new file:   templates/results.html
	new file:   templates/search.html
Initial commit
2020-02-19 06:58:08 +00:00

52 lines
6.4 KiB
HTML

First off, this page needs to be formatted ...
This web application was first put together in an attempt to make the HKHA historical results more acccessible. The current HKHA page is fairly useless, and makes an attempt to conceal historical results, which means in order to review previous season(s) results, you need to use a tool such https://web.archive.org and pick out snapshots of the HKHA website from the date you want to check.
The sad thing is that the HKHA do have these records on their web server, and they are even publicly accessible, they're just not publicly exposed. There is, unsurprisingly, no public API to this data, and instead the results (both the current season and previous seasons) are saved as individual ASP pages. Presumably these are created programmatically and then uploaded to the web server. The data is suitably embedded to make it annoying to extract.
On a separate server I have a job set up to download all the ASP files (this is only done once and only new files on the HKHA web server are retrieved in future requests). A series of bash and python scripts then extract out the data from each match card ASP file so that the following data can be uploaded to a MySQL database:
- Match Number
- Match Date
- Match Time
- Home Club
- Home Team
- Home Score
- Away Club
- Away Team
- Away Score
- Umpire 1
- Umpire 2
- Match Official
Separately, the line ups are then extracted and also uploaded to a MySQL database keeping track of player names, player numbers, appearances, goals, captaincy, and potentially whether they are a goalkeeper. Some teams are better than others about submitting goalkeeper information, so that tends to be a bit random. Some matchcards are 'blank' with no good reason given. When these are encountered, if there is a result on the card, this is recorded, and the player records are updated to reflect that a match took place, but no players are marked as having played. This isn't great, but given there is no data available, there isn't much that can be done here. I should also be tracking yellow/red cards, although this data also appears to be a bit hit and miss on the matchcard data.
Previous seasons are being uploaded/processed as and when I have time. Currently, 2014/15 season is as far back as the database goes - the data should be available back to 2009/10 though, and if I have time this will be uploaded also. Likewise there also appears to be the data for the equivalent ladies matches. If time permits, then this will also be added to the database and application.
As an extension of the match/player tracking side, I decided to add some convenor and team related functionality. The convenor functionality allows me to track the details of the club players I enter the details of. Much more manageable system than the HKHA currently provide, and helps me understand how to connect python to MySQL etc. The team functionality is to create an online MotM/DotD vote.
Initially, the MotM vote would generate a list of players from the players who had previously represented the team. This list was using match card data previously uploaded to the database, and worked fairly well. The drawbacks here were that people could vote for players who were not present at the match which isn't ideal. The player list presented was also originally sorted by the player number which could result in certain players being selected by 'default'. The player list code has been revised so that:
- The 'admin' user must submit a player list before the vote can take place (this is not dis-similar to the HKHA match card system)
- The player list presented is randomised.
- The player names are taken from a convenor maintained database table which means I can incorporate nicknames instead of the formal names used by the HKHA (if no nickname is created in the table, it falls back to using the formal name)
A match comments system has also been added so that players can add a comment on the match they are voting on (if they wish). The voting form also includes one randomly selected match comment (to allow for anyone who wants to try and influence future voters ...). There is a separate comment form so that comments can be added without needing to submit more votes.
At the moment, the vote is 'open'. No login is required and there is limited tracking of votes, which means it is feasible for one person to vote many times. Currently I'm relying on the honour system to keep the process working. It would be relatively straightforward to add a login function required to vote, but this might/would discourage voters.
ARCHITECTURE
The web application is coded with python and uses the flask web framework to run. The backend database is a MySQL database, which python connects easiy to. The flask web application is hosted on the Google Application Engine and the MySQL database is provided by the Google Cloud SQL. The usage levels are low enough that GAE should always qualify for free tier and the Cloud SQL cost is low and is currently being paid for by the free trial credit. The static images/files are uploaded to Google Cloud Storage and their locations are saved into the MySQL database as fields of the objects they represent (typically these are player pictures and other images used on the web application).
It's all very low traffic and therefore a cheap deployment, but with enough activity that it I can understand what works and what doesn't.
Future changes will involve saving various parameters to a settings table so that there is less (no) hardcoding of values which should allow for the whole application to be managed via the webpage. Currently the MotM/DotD tables need to be manually referenced and the Chart that the admin can check to see the vote values also needs to be hardcoded to use the correct tables. This requires a certain amount of manual configuration by the admin before the match is played. If various parameters (such as match date) can be moved to a settings table and read as needed then this would allow the MotM set up and activation to be performed via the web page alone.
More future changes will involve uploading the remaining data from the men's seasons, and then the ladies matches as well.
I'd also like to tidy up the interface and make it more consistent.
The code also needs to be reviewed (again) - and there are undoubtedly repeated bits of code. This is the result of:
a) not knowing python very well
b) only getting to spend short spells on this at random times