Re: Application to watch web pages for changes?
- From: Ignoramus19508 <ignoramus19508@xxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 30 Jan 2008 13:16:56 -0600
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
.
- References:
- Application to watch web pages for changes?
- From: Joshua McGee
- Re: Application to watch web pages for changes?
- From: Chris Davies
- Application to watch web pages for changes?
- Prev by Date: snmpd silently dies after being started
- Next by Date: Re: Application to watch web pages for changes?
- Previous by thread: Re: Application to watch web pages for changes?
- Next by thread: Re: Application to watch web pages for changes?
- Index(es):
Relevant Pages
|