Skip to content

Reminds Me to drink water after every 2 hours by sending a SMS directly to Phone using twilio

Notifications You must be signed in to change notification settings

layersony/h2OIntakeReminder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

H20 Reminder

A Simple Python Script that reminds one to drink water after every 2 hours from 6am to 10pm or 11 pm

Prerequisites

  1. Twilio Account with a Phone Number
  2. Python

How to use this

  1. Clone the repository and cd into repository
  2. Create a python virtual environment and install the requirements
  python -m venv env_myh20
  • Activate the environment
  source env_myh20/bin/activate
  • Install the requirements
  pip install -r requirements.txt
  1. Create a .env file and store you twilio Creds
account_sid='<account_sid>'
auth_token='<auth_token>'
sender_phone_number='<sender_phone_number>' # from twilio
recipient_phone_number='<recipient_phone_number>' # your phone number
  1. Run the application
python3 main.py
  1. To Notify you after every 2 hours we use a cronjob
  • run in terminal
crontab -e
  • Paste the following line into the editor opened
0 */2 6-22 * * <virtual_Environment_Path>/bin/python <File_path>/h2OIntakeReminder/main.py >> <File_path>/h2OIntakeReminder/h2Oreminder_cronjob.log 2>&1

NB remember to change the File_Path and virtual_Environment_Path to your own system path

  • Restart the Cronjob service
sudo service cron restart

Contact Me

Email - sammaingi5@gmail.com

About

Reminds Me to drink water after every 2 hours by sending a SMS directly to Phone using twilio

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages