Instead of manually navigating to the Website everytime to get the current status of the COVID 19 cases in India, I created this automated python script which can be easily executed to receive notifications for the COVID 19 Cases on your Desktop whenever you want.
Note:
- The intention of this simple idea is not to create any form of havoc among others' minds regarding the current state of our country as well as the entire world when the no. of cases are increasing at an ever-increasing rate. This is just a humble attempt so that I as a tech aficionado can contribute to our society in the tiniest manner possible. Please take care and stay safe everyone !!
- The data for this script is taken from here:
- plyer (python package for receing desktop notifications in Windows)
- urllib3
- beautifulsoup4 (for HTML parsing of the website)
- requests
Simply execute pip install <package_name> or conda install <package_name> to install the necessary packages.
- You can execute the script using Terminal/CMD/Powershell by using command: python covid_notify.py
- We won't use anything out of the box. Let us make usage of the *Windows Task Scheduler present in our WindowsOS.
- Just search Windows Task scheduler in the Start Menu and launch the application. Please refer screenshots given below.
-
Enter the name of the task and suitable description, I took it as COVID 19 Tracker INDIA.
-
Set the frequency for task execution, i.e daily,weekly,monthly etc.
-
Set the time interval(s), since I want to execute our script daily.
-
Select the action - Start a program, as we just want to execute the code periodically. We can send E-mails , display messages too but these two features will be soon removed after some subsequent patches.
-
Click on Browse to select the covid_notify.bat file. Please note you have to edit the executable batch file by entering the details of your Python Installation Directory as well as the location of storage of your Python script. You can add the paths in the batch file I have attached here.
Finally, click on save to create the Task. Now, completely forget about it !! As you can now receive Desktop Notifications at the time interval set by you. Happy Automation :)