Skip to content

Sends you updates about the the stats of the people infected by covid in all states in India

Notifications You must be signed in to change notification settings

chindimaga/Update_messenger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Update_messenger

This script sends you updates regularly about the the statistics of the people infected by covid-19 in all states in India.

Requirements

This code is written entirely in python 3. The following libraries are necessary.

  • BeautifulSoup4
  • tabulate
  • requests You can install them by following commands (for linux users):

pip install beautifulsoup4
pip install tabulate
pip install requests

Preview



When ever there is a change in the data, the script automatically sends a message similar to this.

Cron daemon

This will help you run the script at regular time intervals. Ofcourse you have to keep your computer on.

Open your terminal and run this command
crontab -e
Append this text to run the scirpt every 20 mins
*/20 * * * * cd < PATH TO WORKING DIRECTORY >; python main.py

For more info on cron-deamon click this link

Issues faced

  • What if a new state is added: I had deployed this script. But when a new state was added my script stopped working. Resolved this by making small changes in code and by writing the whole code inside a try block and in the except block i made sure that i would get an error message if the script doesn't work.
  • When the data already stored is lost by accident: If by any chance the data is lost (i deleted the json file) it shot an error. I tried making it more robust by automatically creating a new database and start storing the data from that time stamp and send a message to the user that the database was lost and new database has been initialised.

Slack client

You get a webhook when you create an app. Using the web hook you can easily send the message to your thread. If you are working in machine learning , you can use the code to get updates about how much the training has been done. You can get notifications on phone if you install the app. Make an auth.py file in the working directory and store your webhook in this file. Type the following command in your teminal.

touch auth.py

Dataset

Finally i have a data set, which is almost ready for a time series analysis

If you feel that i can further improve my code, please feel free to contact me.

About

Sends you updates about the the stats of the people infected by covid in all states in India

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages