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)
Installation of the required libraries
pip install -r requirements.txt
-
You will be provided with a dashboard.
-
Go to Settings and you will see your 'ACCOUNT SID' and 'AUTH TOKEN' under 'LIVE CREDENTIALS'.
-
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 '+'.
- Then go your active numbers and in the messaging section setup your webhook by entering your domain in the 'A Message comes in" section.
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.
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
Run the development server using
flask run
You can manually send a request to recieve an SMS by running
python schedule.py
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
Give a ⭐ if you like my project❤️