-Script to automatically send whatsapp message if Kadama bus transport card is low on balance. This Python script checks your KTCL smart card balance and sends a WhatsApp notification if the balance is below a certain threshold.
- Scrapes KTCL website for card balance
- Sends an automatic WhatsApp message if balance is low
- Uses WhatsApp Web for messaging (requires login)
- Python 3.x
- Web browser installed (for WhatsApp Web automation)
- Required Python libraries (install using
requirements.txt) - Configure own whatsapp number and details in the script.
- Clone or download this repository.
- Install dependencies:
pip install -r requirements.txt
- Run the script:
python ktc.py
- Enter your KTCL card number and WhatsApp phone number when prompted.
- The script will fetch your balance and send a WhatsApp message if the balance is low.
- Open Task Scheduler (
taskschd.mscvia Run dialogWin + R). - Click Create Basic Task and name it appropriately.
- Choose Daily or your preferred schedule.
- Select Start a Program, then browse for
python.exe. - Add arguments:
path\to\ktc.py. - Click Finish to schedule the task.
- Open Terminal and type:
crontab -e
- Add the following line to schedule it daily at 9 AM:
0 9 * * * /usr/bin/python3 /path/to/ktc.py
- Save and exit. Use
crontab -lto verify the scheduled job.
- WhatsApp Web must be logged in.
- This script relies on web scraping, so any changes to the KTCL website may break functionality.
This project is for educational purposes only. Use at your own risk.