This script monitors specified JavaScript files for changes. When a change is detected, it sends a notification via Telegram with a detailed comparison of the changes.
- Monitors JavaScript files for changes
- Sends notifications through Telegram with detailed change logs
- Highlights significant changes for easy identification
Before you begin, ensure you have met the following requirements:
- Python 3.x installed on your system
- A Telegram bot and chat ID (Instructions below on how to obtain these)
- Clone the repository:
git clone https://github.com/leetIbrahim/JSNotify.git
- Install the required Python packages:
pip install -r requirements.txt
- Create a .env file in the root directory of the project with the following content:
TELEGRAM_TOKEN=[Your_Telegram_Bot_Token] TELEGRAM_CHAT_ID=[Your_Telegram_Chat_ID]
Replace [Your_Telegram_Bot_Token]
and [Your_Telegram_Chat_ID]
with your actual Telegram bot token and chat ID.
- To obtain a Telegram bot token and chat ID , follow the instructions provided here.
-
Prepare a text file containing the URLs of the JavaScript files you want to monitor, one URL per line.
-
Run the script and follow the prompts:
python3 monitor.py
-
Enter the path to your file containing the URLs when prompted.
https://example.com/main.js https://example.com/app.js
-
The script will monitor these URLs and send notifications via Telegram if any changes are detected.
Below is an example of what the notification looks like:
Follow me on Twitter @leetibrahim for updates.