Close
0%
0%

WhatsApp Coronavirus Notifier Bot on Raspberry Pi

Via WhatsApp, observe the daily coronavirus(COVID-19) case report of your country in a given period and get notified when there is a change.

Similar projects worth following
First of all, I hope that you and your loved ones are safe and healthy during these unprecedented times.

Tracking the current data on the daily impact of the coronavirus had encumbered lots of my friends' and acquaintances' thought processes due to the uncertain data update times. Hence, I developed a bot hosted by a Raspberry Pi, which notifies the user when there is a change in the daily case report of the selected country via WhatsApp, in the hope of soothing their minds even a little bit. In other words, you will get notified via WhatsApp (as notification messages) when the daily case report of your country is uploaded or updated by the data provider - The 2019 Novel Coronavirus Visual Dashboard operated by the Johns Hopkins University Center for Systems Science and Engineering (JHU CSSE) with the support of ESRI Living Atlas Team and the Johns Hopkins University Applied Physics Lab (JHU APL).

Download the coronavirus notifier bot and get more information about the project from here.

Also, the notifier bot sends an information message in the given period if there is no change (STABLE).

The project in a nutshell:

To obtain the information from the data provider(JHU CSSE with JHU APL), I used a well-programmed application by Rodrigo Pombo (pomber). It collects all the required data for the bot in a JSON file.

As you may have got familiar with my previous projects, to send notification messages via WhatsApp, I used the Twilio's API for WhatsApp in PHP.

To host the coronavirus notifier bot and manage the data evaluation process automatically in PHP to detect the data status of the selected country (STABLE or CHANGED), I set up a LAMP (Linux, Apache, MySQL, PHP) server with MariaDB on Raspberry Pi.

Running on the LAMP server hosted by Raspberry Pi, I designed a user-friendly interface in which you can change the country whose data is collated and enter your Twilio application settings (SID, AUTH_TOKEN, from_phone_number, to_phone_number). The interface also allows you to automatically create a database table named variables before activating the notifier bot. And thus, without needing any coding, you can observe the daily coronavirus case report of the selected country by merely using the bot interface.

By the following steps, you can replicate the WhatsApp coronavirus notifier bot project to run it on your Raspberry Pi or your personal computer as the localhost.

Preview: What You Will Learn

  • How to create a Twilio application
  • How to install and configure Apache, PHP, and MySQL to create a LAMP web server on Raspberry Pi
  • How to install CURL on Raspberry Pi
  • How to define a new user and create a new database with MariaDB on Raspberry Pi
  • How to develop a web application (bot) in PHP to send WhatsApp notification or information messages depending on the incoming data from an external server
  • How to install the bot on Raspberry Pi
  • How to activate the bot terminal in a loop on Raspberry Pi

Step 1: Creating a Twilio application

To send WhatsApp messages through Twilio's API, the only thing you need to do is to sign up for a Twilio Trial Account.

After signing up, with your SID and Auth Token, you can use Twilio's API for WhatsApp without any charge. As explained on Twilio, you need to join a shared phone number with your phone in order to verify your phone number and initiate the Twilio's API for WhatsApp.

For more information and learn how to create a new account, click the link below.

Go to Twilio.

You can sign up for Twilio with my referral code here.

1) Create a new application

2) Go to the Sandbox to get the code

3) Connect your phone to your application with the code

Step 2: Setting up a LAMP web server on Raspberry Pi

If you are a novice in programming with Raspberry Pi, you can inspect well-explained instructions and tutorials on the official Raspberry Pi website.

To go to the official Raspberry Pi setting up tutorial, click here.

  • Open a terminal window by selecting Accessories > Terminal from the menu.
  • Install the apache2 package by typing the following command into the terminal and pressing Enter:
sudo apt-get install apache2 -y
  • To test the server, open Chromium by selecting Internet > Chromium Web Browser from the menu and enter http://localhost.
  • If you want, you can use the IP address of your Raspberry Pi as well.
hostname -I
  • Install the PHP package with the following command:
  • Do not forget to update the Pi.
sudo apt-get update
sudo apt-get install php -y

- Install the MySQL Server (MariaDB) and PHP-MySQL packages by entering the following command into the terminal window:

sudo apt-get install mariadb-server php-mysql -y
  • To create a new user, run the MySQL secure installation command in the terminal window.
sudo mysql_secure_installation
  • You will be asked Enter current password for root (enter for none): — press Enter.
  • Type in...
Read more »

  • 1 × Raspberry Pi 3 Model B+
  • 1 × SD Card (32GB)

  • 1
    Schematic

View all instructions

Enjoy this project?

Share

Discussions

kashmalabaloch075 wrote 08/16/2024 at 11:07 point

is this safe to use modified application on android same like whatsapp gb ? if anyone knows pleas explain sample is attached : https://whatsmody.net/tm-whatsapp/

  Are you sure? yes | no

kutluhan_aktar wrote 04/14/2020 at 23:35 point

Please feel free to leave a comment here if you have any questions or concerns regarding this project.

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates