This bot is a very simple slackbot that pulls data, summarises and posts up to date AU COVID & Vaccine target stats to a provided slack channel. Sourcing data from https://covidlive.com.au
Daily Vaccine Target Stats Example:
Assuming you have virtualenv and pip installed the below will setup the requirements.
virtualenv venv --version 3.7
source venv/bin/activate
pip3 install -r requirements.txt
Follow this slack tutorial to setup a new slack app
Make sure you note down the name of your bot, and your OAuth token, they will need to be set as env vars below.
Once you have your bot create a new slack channel (note the name down for below)
type /invite @<MyBotName>
into the channel you wish to add the bot to
A number of env vars need to be setup whereever you plan to run the bot
export SELECTED_CODES="VIC,NSW,QLD,NT,SA,ACT,WA,TAS,AUS"
export SLACK_CHANNEL_NAME="#<MyChannelNameHere>"
export SLACK_BOT_TOKEN="Slack OAuthTokenHere"
export SLACK_BOT_NAME="Slack Bot Name here"
export SLACK_BOT_DISPLAY="CODE_DATA,VAX_DATA" # CODE_DATA is covid stats, VAX_DATA is vaccine targets
# Locally
python3 post_covid_stats.py
# docker run dockerhub image
docker run \
-e "SELECTED_CODES=VIC,NSW" \
-e "SLACK_BOT_DISPLAY=CODE_DATA,VAX_DATA" \
-e "SLACK_BOT_TOKEN=$SLACK_BOT_TOKEN" \
-e "SLACK_CHANNEL_NAME=$SLACK_CHANNEL_NAME" \
-e "SLACK_BOT_NAME=$SLACK_BOT_NAME" \
boycey/covidliveslackbot:latest
# docker run self built image
docker run \
-e "SELECTED_CODES=VIC,NSW" \
-e "SLACK_BOT_DISPLAY=CODE_DATA,VAX_DATA" \
-e "SLACK_BOT_TOKEN=$SLACK_BOT_TOKEN" \
-e "SLACK_CHANNEL_NAME=$SLACK_CHANNEL_NAME" \
-e "SLACK_BOT_NAME=$SLACK_BOT_NAME" \
covidliveslackbot:latest
docker build -t covidliveslackbot:latest .