This project is created for getting COVID Vaccine alerts on my SLACK Channel.
I created and deployed this project on my AWS in an hour so any Code Improvements are welcome.
Email me at [email protected] with your user credentials to get alerts on your channel too!
- Clone repo.
- Create python3 virtualenv.
python3 -m venv .venv
- Activate virtualenv.
source .venv/bin/activate
- Install dependencies.
pip install -r requirements.txt
- Update User Credentials file.
[
{
"token": "<your www.cowin.gov.in user token>",
"state": <your cowin unique state id>,
"districts": [<your cowin unique district ids>],
"slack_member_id": "<your slack member id>",
"SLACK_WEBHOOK": "<your slack webhook>"
},
{
"token": "<your www.cowin.gov.in user token>",
"state": <your cowin unique state id>,
"districts": [<your cowin unique district ids>],
"slack_member_id": "<your slack member id>",
"SLACK_WEBHOOK": "<your slack webhook>"
},
]
- Run the script.
cd /home/ubuntu/saurabh/cowin-updates/ && /home/ubuntu/saurabh/cowin-updates/.venv/bin/python /home/ubuntu/saurabh/cowin-updates/cowin_alerts.py >> /home/ubuntu/saurabh/cowin-updates/cowin_alerts_log.py
- Add to crontab.
crontab -e
*/1 * * * * cd /home/ubuntu/saurabh/cowin-updates/ && /home/ubuntu/saurabh/cowin-updates/.venv/bin/python /home/ubuntu/saurabh/cowin-updates/cowin_alerts.py >> /home/ubuntu/saurabh/cowin-updates/cowin_alerts_log.py 2>&1