A simple script & container to pull COVID data from covidlive.com.au and post a summary to a slack channel

Overview

CovidLive AU Summary Slackbot

This bot is a very simple slackbot that pulls data, summarises and posts up to date AU COVID stats to a provided slack channel. Sourcing data from https://covidlive.com.au

example-message

Install

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

Slack Setup

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

Bot Setup

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" 

Run me

# Locally
python3 post_covid_stats.py

# docker run dockerhub image
docker run \
    -e "SELECTED_CODES=VIC,NSW" \
    -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_TOKEN=$SLACK_BOT_TOKEN" \
    -e "SLACK_CHANNEL_NAME=$SLACK_CHANNEL_NAME" \
    -e "SLACK_BOT_NAME=$SLACK_BOT_NAME" \
    covidliveslackbot:latest

Build new image

docker build -t covidliveslackbot:latest .
You might also like...
A simple python bot that serves to send some notifications about GitHub events to Slack.
A simple python bot that serves to send some notifications about GitHub events to Slack.

github alerts slack bot 🤖 What is it? 🔍 This is a simple bot that serves to send some notifications about GitHub events to Slack channels. These are

A fun hangman style game to guess random movie names with a short summary about the movie.

hang-movie-man Hangman but for movies 😉 This is a fun hangman style game to guess random movie names from the local database and show some summary ab

Trellox Tool is written in Python3 and designed to pull and list Trello boards.
Trellox Tool is written in Python3 and designed to pull and list Trello boards.

TrelloX Trellox Tool is written in Python3 and designed to list and pull Trello boards. It can be used by penetration testers/bug bounty hunters to de

A simple script that will watch a stream for you and earn the channel points.
A simple script that will watch a stream for you and earn the channel points.

Credits Main idea: https://github.com/gottagofaster236/Twitch-Channel-Points-Miner Bet system (Selenium): https://github.com/ClementRoyer/TwitchAutoCo

This Lambda will Pull propagated routes from TGW and update VPC route table

AWS-Transitgateway-Route-Propagation This Lambda will Pull propagated routes from TGW and update VPC route table. Tested on python 3.8 Lambda AWS INST

This bot will pull a stream of tweets based on rules you set and automatically reply to them.

Twitter reply bot This bot will pull a stream of tweets based on rules you set and automatically reply to them. I built this bot in order to help comb

Script to post multiple status(posts) on twitter

Script to post multiple status on twitter (i.e. TWITTER STORM) This program can post upto maximum limit of twitter(around 300 tweets) within seconds.

A script that writes automatic instagram comments under a post

Send automatic messages under a post on instagram Instagram will rate limit you after some time. From there on you can only post 1 comment every 40 se

CryptoApp - Python code to pull wallet balances from a variety of different chains through nothing other than your public key.

CryptoApp - Python code to pull wallet balances from a variety of different chains through nothing other than your public key.

Comments
  • Support for percentage based vaccination details

    Support for percentage based vaccination details

    Adds support for percentages of population for first and second dose. Falls back to previous updates vaccinations if latest update does not contain them. Falls back to latest update if latest record is null

    opened by handyjellyfish 5
  • Addition of Vax Stats

    Addition of Vax Stats

    Adds a Vax Stats feature counting down to certain whole number percentages. Can be run in conjunction with (default), or separately from the existing code output.

    Recommend running it with AUS,NSW,VIC for good coverage and info.

    Let me know thoughts!

    image

    opened by handyjellyfish 2
  • Fix to extend

    Fix to extend

    Suggested change didn't work :)

    extend returns none and the internal iterator was creating a list of lists and wasn't extending properly anyway. Tried to come in with a compromise here :D

    opened by handyjellyfish 0
  • Fixing test PR

    Fixing test PR

    Hi James,

    This fixes the issue with the test. Cleaned it up slightly too. Working fine before this, because this field still exists in the live data, and then the printout uses the new normalised field, but in the the test I very explicitly excluded those fields to ensure something like this wouldn't fall through, and then forgot to run the second test 🤦

    opened by handyjellyfish 0
Owner
James
Developer
James
Google scholar share - Simple python script to pull Google Scholar data from an author's profile

google_scholar_share Simple python script to pull Google Scholar data from an au

Paul Goldsmith-Pinkham 9 Sep 15, 2022
Python app to notify via slack channel the status_code change from an URL

Python app to notify, via slack channel you choose to be notified, for the status_code change from the URL list you setup to be checked every yy seconds

Pedro Nunes 1 Oct 25, 2021
A Script to automate fowarding all new messages from one/many channel(s) to another channel(s), without the forwarded tag.

Channel Auto Message Forward A script to automate fowarding all new messages from one/many channel(s) to another channel(s), without the forwarded tag

null 16 Oct 21, 2022
A Script to automate fowarding all new messages from one/many channel(s) to another channel(s), without the forwarded tag.

Channel Auto Message Post A script to automate fowarding all new messages from one/many channel(s) to another channel(s), without the forwarded tag. C

null 16 Oct 21, 2022
It connects to Telegram's API. It generates JSON files containing channel's data, including channel's information and posts.

It connects to Telegram's API. It generates JSON files containing channel's data, including channel's information and posts. You can search for a specific channel, or a set of channels provided in a text file (one channel per line.)

Esteban Ponce de Leon 75 Jan 2, 2023
Upload on Doodstream by Url, File and also by direct forward post from other channel...

Upload on Doodstream by Url, File and also by direct forward post from other channel...

Pʀᴇᴅᴀᴛᴏʀ 8 Aug 10, 2022
As Slack no longer provides an API to invite people, this is a Selenium Python script to do so

As Slack no longer provides an API to invite people, this is a Selenium Python script to do so

Mehdi Bounya 4 Feb 15, 2022
Send notification to your telegram group/channel/private whenever a new video is uploaded on a youtube channel!

YouTube Feeds Bot. Send notification to your telegram group/channel/private whenever a new video is uploaded on a youtube channel! Variables BOT_TOKEN

Aditya 30 Dec 7, 2022
Python bot for send videos of a Youtube channel to a telegram group , channel or chat

py_youtube_to_telegram Usage: If you want to install ytt and use it, run this command: sudo sh -c "$(curl -fsSL https://raw.githubusercontent.com/nima

Nima Fanniasl 8 Nov 22, 2022
A Bot Telegram Anti Users Channel to automatic ban users who using channel to send message in group.

Tg_Anti_UsersChannel A Bot Telegram Anti Users Channel to automatic ban users who using channel to send message in group. Features: Automatic ban Whit

idzeroid 6 Dec 26, 2021