Script to be activated if web page changes I'm looking for a way to have a script running on my desktop that will check a certain webpage for changes every x seconds, and if a change is made, it gives me an alert. I understand that with high-end websites, some changes will be made almost constantly, but what I'm looking for monitoring now is a bare-bones HTML page that I'm waiting for a link to show up on. Is there a way to do this?

Edit:
Would it be a command to download the html and store it, and then a recurring download-and-check command?
Save this as ~/bin/example and run chmod +x ~/bin/example. (Edited to only check the modification date from the header.)

#!/bin/bash

url=http://www.iana.org/domains/example
tempdir=~/Library/Caches/scripts
temp=$tempdir/example
mkdir -p $tempdir
modified=$(curl -sI "$url" | grep ^Last-Modified)
if [[ -f "$temp" &amp;&amp; "$modified" != "$(cat $temp)" ]]; then
    terminal-notifier -message 'Example changed'
fi
printf %s "$modified" &gt; $temp


To run it every 15 minutes, add */15 * * * * ~/bin/example to crontab (EDITOR=nano crontab -e).

terminal-notifier can be installed with sudo gem install terminal-notifier.

You could also run it every five seconds in a shell window:

while :; do ~/bin/example; sleep 5; done