This device is not compatible.
PROJECT
Build a Telegram Bot in Node.js for Web Page Change Detection
In this project, we’ll automate checking for site updates using Node.js. We’ll learn how to periodically download a web page and see if it has changed since the last check. Lastly, we’ll be notified of any page changes via Telegram.
You will learn to:
Practice the fundamentals of bot automation.
Understand the basics of communicating with Telegram bot.
Create a script in Node.js that executes a scheduled task.
Get notified via Telegram when a site changes.
Skill
Task Automation
Prerequisites
Access to the Telegram messenger
Basic understanding of Node.js
Basic understanding of command-line scripting
Basic understanding of how Telegram bots work
Technologies
HTML
Node.js
JavaScript
Project Description
The Telegram Bot API provides everything we need to build applications that use Telegram messages as an interface. It enables notification automation via Telegram and more because of its extensive technology integration capabilities.
In this project, we’ll build a Node script that accepts a few command-line options. We’ll download the page to the URL received as an input using the Node.js Fetch API. Then, we’ll access and store its HTML. We’ll repeat this procedure regularly over a configurable time frame, verifying whether the target page’s content has changed since the last check.
Finally, we’ll use the Node.js Telegram Bot API client to send a message informing a Telegram bot about the page changes.
Project Tasks
1
Initial Setup
Task 0: Get Started
Task 1: Create a Telegram Bot
Task 2: Create a Chat with the Telegram Bot
2
Define the HTML Change Detection Logic
Task 3: Read the Command-Line Arguments
Task 4: Validate the Command-Line Arguments
Task 5: Retrieve the HTML of the Target Page
Task 6: Schedule the Detection Task
Task 7: Implement the HTML Comparison Logic
Task 8: Notify HTML Changes via Telegram
3
Test the Telegram Bot
Task 9: Verify That the Telegram Bot Works as Expected
Congratulations!
Relevant Courses
Use the following content to review prerequisites or explore specific concepts in detail.