NOTE: This is a fork of ImDevinC/wc-watcher which is updated for mattermost and dockerized(I didnt want to mess with my Pyhton 2.7 installation and/or systemd settings for this process :-P)
This bot uses the undocumented FIFA API's to report on World Cup matches. It will check every 60 seconds for new events. The following events are reported:
- Goals scored
- Yellow/Red cards
- Substitutions
- Match start/stop
- Penalty kicks missed/scored
A simple Dockerfile
is included for deploying this in a docker container.
- Clone the repo and navigate into the directory
- Make necessary changes to private.py (see instructions below, at the minimum your webhook url has to be updated)
- Build the docker image locally by running the following command, you can change the image name to your liking
docker build -t thiyag/wc-watcher .
- Once the image is built, run the process in a new container, this runs as a daemon (
-d
)
docker run -d --name wcbot thiyag/wc-watcher
- To update the code and or config, rebuild the image, and before issuing
docker run
, delete/remove the existing container
docker stop wcbot
docker rm wcbot
- Setup a new Mattermost incoming webhook and retain the url to use in
WEBHOOK_URL
below - Copy
private.py.config
toprivate.py
- In
private.py
, changeWEBHOOK_URL
to point to your Slack webhook- If you want to see debug information, which currently pings a heartbeat every hour, also fill in the
DEBUG_WEBHOOK
url with a Mattermost webhook and setDEBUG = True
- You can also set
WC_COMPETITION = None
insoccerbot.py
to get all current FIFA matches and see what the output looks like. Just make sure to change it back toWC_COMPETITION = 17
for world cup only
- If you want to see debug information, which currently pings a heartbeat every hour, also fill in the
- In
private.py
, leave theCHANNEL
blank, mattermost's incoming webhook will already have the channel it would post to, entering a channel name or id would cause the webhook to fail - Use
pip install -r requirements.txt
- Run
python soccerbot.py
- Go to the
Custom Emoji
screen in mattermost - Enter
yellow_card_new
as name - Upload
hand_yellow_card.png
- Save emoji
Repeat for red_card_new
and hand_red_card.png