WasThereAnNhlGameYesterday?
Print YES or NO!
endpoint | function | format | example | admin |
---|---|---|---|---|
/$TEAM | YES/NO | HTML* | RedWings | |
/$CITYTEAM | YES/NO | HTML* | DetroitRedWings | |
/$CITY | YES/NO | HTML* | Detroit | |
/$SHORT | YES/NO | HTML* | DET | |
/$DATE/$TEAM | YES/NO | HTML* | 20171022/RedWings | |
/$TEAM/$DATE | YES/NO | HTML* | RedWings/20171111 | |
/get_schedule | Print Schedule | JSON | ||
/version | Print Schedule Update Time | JSON/ISODATE | { "version": "2018-01-27T08:57:00.372800" } | |
/menu | Present user with a clickable menu | HTML | menu | |
/update_schedule | Update Schedule | 202 on changed | Y |
* If you use Curl, Wget or Python-Urllib then all you get is YES or NO
case insensitive:
- https://wtangy.se
- https://wtangy.se/det
- https://wtangy.se/redwings
- https://wtangy.se/nyrangers
- https://wtangy.se/Vgk
- https://wtangy.se/newyorkrangers
- https://wtangy.se/new york rangers
- https://wtangy.se/New%20Jersey%20Devils
- https://wtangy.se/Montréal
- https://wtangy.se/St Louis Blues
- https://wtangy.se/20171222
- https://wtangy.se/22-12-2017
- https://wtangy.se/22-12-2017/DET
- https://wtangy.se/lak/20171014
- https://wtangy.se/foo/20171014
- https://wtangy.se/foo/20170901
What do these mean?
- Not choosing anything just tells you if there was a game yesterday
- Choosing a team means you only get YES if that team played yesterday.
- Choosing a date means you only get YES if there is a game on that date.
- Choosing a team and a date you only get YES if the chosen team plays/played on that date.
- Choosing a team incorrectly and a date correctly you only get YES if there was/is a game on that date
- Choosing a team correctly and a date incorrectly you get a big NO
There's also:
- https://wtangy.se/menu # select a team
- https://wtangy.se/get_schedule # get the schedule this website uses in JSON
- https://wtangy.se/update_schedule # for admins only
- https://wtangy.se/version # tells when the backend schedule was last updated
- Persistent team selection using HTML5 Web Storage. If you choose a team in the menu and you later revisit https://wtangy.se (from the same browser) you'll see the result for that team.
- This works with the new new NHL.com website (2023-)
So I(author) live in a timezone where the NHL games are often over at 5am in the morning, sometimes they start then. I tend to watch replays. I'm not always sure if there was a game yesterday. Schedules online often have the results, news or "yes, also it went to overtime" to spoil the game.
It would be really nice if I could just browse to $URL/team and it would tell me if my team played yesterday or during Stanley Cup (or regular season) $URL would be enough to just tell me if there was a game at all.
Now there is! :)
The schedule used by this web site is stored in the backend.
As an admin you can update it manually or configure a cronjob. It will send an e-mail with schedule changes outside playoffs.
It also worked for 2020-21 playoffs :)
Currently the script doesn't differentiate between playoffs and regular seasons.
It just takes the dates from NHL.com's API. There are more arguments to this API that I have not found any official documentation for. There is however https://gitlab.com/dword4/nhlapi/-/blob/master/new-api.md great resource by dword4.
- Choosing background color - would be sweet if it could do HTML5 so users can choose themselves too like in https://www.w3schools.com/colors/colors_picker.asp
- games include preseason - if this is a problem let me know!
- add a calendar selection too near the menu?
- dynamically generate a sitemap.xml
- And/Or fail build if the one we have is out of date
- improve testing
- update schedule_testing and then verify it / validate json
- performance testing
- lint javascript,css,html
- lint python #16
- Use Google KMS For Encrypting Secrets
- Twitter Keys are stored in a private bucket
gcloud - reminders for myself.
Forked from https://github.com/amanjeev/isitfridaythe13th because it had the google appspot already in it and python :) Thanks! In 2022 this fork was extracted/detached because the upstream Friday 13 had been archived and because one couldn't change pull requests to by default target the wtangy repo.
wasthereannhlgamelastnight(..) has been re-written a few times - it's no longer even close to the isitfridaythe13th, for example:
- it now uses webapp2 for example instead of python print to stdout.
- it used to have a manual NHL_schedule.py with a set and a list, now it reads and writes to gcloud object store!
- used to be python2 and webapp2 on GAE, in 2022 it's python3 and Flask on GAE!