Re: Application to watch web pages for changes?



On 2008-01-30, Chris Davies <chris-usenet@xxxxxxxxxxxx> wrote:
Joshua McGee <joshua@xxxxxxxxxx> wrote:
I'd like a Linux application that would watch a web page for changes,
and then either email you diffs or publish a feed. Anyone know of
one?

I wrote a script like this. I use it a lot to monitor all kinds of
things. Not just webpages. For example, my eBay feedback, Commission
Junction affiliate revenue, pagerank of my website, prices of my
stocks, etc.

It monitors output of a given command and does "wall" and sends me
email when something changes. I use it, for example, to monitor whois
information on my domain algebra.com, to be notified in the unlikely
event that this domain name is stolen from me via forgery etc.

You just run it from cron like this

10 8 * * * $HOME/bin/keep-an-eye MyPR bash -i -c mypr

#!/bin/sh

NAME=$1; shift
COMMAND=$@

FILE=/tmp/eye.$NAME

if [ "x$1" = "x--reset" ] ; then
shift
COMMAND=$@
$COMMAND > $FILE
exit 0
fi

COMMAND=$@

if $COMMAND > $FILE.tmp 2>>$FILE.error ; then
# We succeeded
if [ -f $FILE ]; then
diff $FILE $FILE.tmp > $FILE.diff
if [ "$?" = 1 ] ; then
(
echo Watching $name: change detected.
echo ==================================
cat $FILE.diff
echo ==================================
cat $FILE.tmp
) | Mail -s "WATCH: Change in $NAME on `date`" `whoami`
echo Change in $NAME on `date` | wall
fi
fi
rm -f $FILE.diff
mv $FILE.tmp $FILE
else
# We failed, do nothing
echo nothing done, error code $? >> $FILE.error
fi

.



Relevant Pages

  • Re: View text on CRT monitor
    ... >>> justified and slammed solidly against the left side of the monitor. ... I can fix this easily by holding the Shift ... >>> the right one inch and the document follows the ruler. ...
    (microsoft.public.word.vba.beginners)
  • Re: View text on CRT monitor
    ... Hi Tony, ... >> justified and slammed solidly against the left side of the monitor. ... I can fix this easily by holding the Shift ... >> and clicking the left scroll button. ...
    (microsoft.public.word.vba.beginners)
  • Re: Dell P922 monitor
    ... Yes, it's a Sony monitor. ... Most of the problems I have seen are for Excessively bright picture. ... R459 is the best to Mod and Have found that 5.6M ohms to 7.5M ohms to be the ... Darker settings will shift to blue and brighter settings will ...
    (sci.electronics.repair)
  • Re: AVI clip properly inserted in Powerpoint turns blank
    ... it is a projected image (second monitor or LCD projector) the problem is the ... drive the computer's screen and the projector/2nd monitor screen. ... the top of the keyboard that causes a shift in the monitor. ... latest video drivers for the video card in the computer. ...
    (microsoft.public.office.misc)
  • Re: Cats and Monitors!
    ... > Our cat had taken to parking herself on top of a 21" monitor which gave ... The cat, well she seems none ... > the worse for her sudden trip on to the floor now she has come out from hiding. ...
    (uk.comp.sys.mac)