/covid-sms-notify

A Flask app that sends covid stats from an api using python-twilio

Primary LanguagePython

Twilio-Covid SMS Notifier

GitHub stars

This project is based on an api that serves data regarding the covid-19 cases of Kerala(which can be changed according to requirement) and sends it to your mobile via SMS(This process can be changed using crontab)

Current-Covid World Stats

Covid-19 Cases Covid-19 Deaths

Installation

Installation of the required libraries

pip install -r requirements.txt

Setting up your Twilio Account

  • SignUp your first twilio account

  • You will be provided with a dashboard.

  • Go to Settings and you will see your 'ACCOUNT SID' and 'AUTH TOKEN' under 'LIVE CREDENTIALS'.

Verified Number

  • Go to 'Products and Services' on the left dashboard.

  • Then go to 'Phone numbers' under Super Network in order to get the numbers verified that you need to send the SMS update.

  • You need to manually verify the numbers you need by clicking the '+'.

Verified Number

  • Then go your active numbers and in the messaging section setup your webhook by entering your domain in the 'A Message comes in" section.

Webhook

Setting up the Program

Add your Account SID and Auth Token

ACCOUNT_SID = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
AUTH_TOKEN= 'your_auth_token' 

Then add the trial number created for your Account and your verified number

from_='+1********' #YOUR TRIAL PHONE NUMBER
to=' ' #THE VERIFIED NUMBER THAT YOU NEED TO SEND THE SMS

This is only a trial account so you can send SMS to only a single number at a time.

Covid India API

I have used covidindia API for getting the covid stats for my state.You can modify the JSON query to fetch your states data.See their documentation for more details

Usage

Run the development server using

flask run

Send GET request

You can manually send a request to recieve an SMS by running

python schedule.py

SMS

Scheduling SMS

If you feel like you need to change the time for recieving updates.

crontab -e

Then append the following line and save

* * * * *  /usr/bin/python /path/to/schedule.py

where the parameters are as

param

Support this project

Give a ⭐ if you like my project❤️