O'Reilly logo

Linux Shell Scripting Cookbook by Sarath Lakshman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Tracking changes to a website

Tracking changes to a website is helpful to web developers and users. Checking a website manually in intervals is really hard and impractical. Hence we can write a change tracker running at repeated intervals. When a change occurs, it can play a sound or send a notification. Let's see how to write a basic tracker for the website changes.

Getting ready

Tracking changes in terms of Bash scripting means fetching websites at different times and taking the difference using the diff command. We can use curl and diff to do this.

How to do it...

Let's write a Bash script by combining different commands to track changes in a web page:

#!/bin/bash #Filename: change_track.sh #Desc: Script to track changes to webpage if [ $# -eq 2 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required