Skip to content

Instantly share code, notes, and snippets.

@PierrickKoch
Last active December 16, 2015 19:39
Show Gist options
  • Select an option

  • Save PierrickKoch/5487104 to your computer and use it in GitHub Desktop.

Select an option

Save PierrickKoch/5487104 to your computer and use it in GitHub Desktop.
alert web diff
#!/bin/bash
[ -z "$1" ] && echo "usage: $0 URL [TIME]" && exit 1
[ -z "$2" ] && tempo=$2 || tempo=10
url=$1
fileA=`mktemp`
fileB=`mktemp`
wget $url -qO $fileA
while [ -z "$webdiff" ]; do
wget $url -qO $fileB
webdiff=`diff -u1 $fileA $fileB`
[ -z "$webdiff" ] && echo -n . && sleep $tempo
done
diff -u1 $fileA $fileB
notify-send --urgency=low -i terminal "$url"
rm $fileA $fileB
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment