This Python script is designed to monitor changes in your LMS courses and send notifications to a Discord channel when new content is detected. It utilizes web scraping techniques to compare the current course content with the previous state and notifies users of any updates.
- Automatic Monitoring: The script periodically checks for updates in your LMS courses.
- Discord Notifications: Notifications are sent to a Discord channel with details about the new content.
Before running the script, make sure you have the following:
- Python installed
- Required Python packages installed (
requests
,beautifulsoup4
,Flask
)
After deploying this script, make sure you do this:
- https://your-domain.vercel.app/get: Come to browser and enter this url until it returns : Crawl Successfully
To ensure the script runs continuously, follow these steps:
-
Go to UptimeRobot and create a free account.
-
After logging in, click on + Add New Monitor.
-
Choose HTTP(s) as the monitor type.
-
In the Monitor Name field, give your monitor a name (e.g., LMS Notification).
-
In the URL (or IP) field, paste the Vercel project URL and add https://your-domain.vercel.app/recheck. Example: your-domain.vercel.app/recheck
-
Set the Check Interval to 5 minutes.
-
Click Create a Monitor.
-
For example, if you have 21 course, create 3 monitors. Because each run it will check 10 links, so it need 3 monitors. Ex: https://your-domain.vercel.app/recheck?1, https://your-domain.vercel.app/recheck?2, https://your-domain.vercel.app/recheck?3
-
Remember to add https://your-domain.vercel.app/get so if the program get interrupt, it will crawl the data again.
Now, UptimeRobot will ping your Vercel project every 5 minutes, keeping it active.
-
Clone the repository:
git clone https://github.com/KenKout/lms_notification
-
Install the required packages:
pip install -r requirements.txt
-
Set up environment variables:
WEBHOOK
: Discord webhook URL for notifications.USERNAME
: Your E-Learning username.PASSWORD
: Your E-Learning password.
-
Run the script:
python main.py
You can customize the following parameters in the script:
Debug
: Set toTrue
for additional debug information.
- This script is provided as-is, and the developer is not responsible for any misuse or damage caused by it.
- Use responsibly and adhere to the terms of service of the platforms being accessed.
Feel free to contribute to the project or report issues on the GitHub repository.