[Tfug] Checking for updated webpage
Andrew Ayre
andy at britishideas.com
Mon Sep 8 14:17:22 MST 2008
Paul Lemmons wrote:
> -------- Original Message --------
> Subject: Re:[Tfug] Checking for updated webpage
> From: Jeff Breadner <jeff at breadner.ca>
> To: TFUG <tfug at tfug.org>
> Date: 09/08/2008 01:45 PM
>>> I'm looking for an app that will monitor a specific webpage and inform
>>> me when it's been updated (the site doesn't provide a feed). I found
>>> specto, but it wants to pull in the whole GNOME infrastructure. For
>>> my purposes, a daily cronjob that runs wget and diffs the page might
>>> be the simplest way. Any suggestions?
>>>
>>>
>>>
>>
>> Here's a quickie, untested bash script. It will notify you whenever
>> something changes, then update the reference point so you won't get
>> notified again until things change again. It doesn't test for
>> connectivity, you might want to put a ping test "if" statement around
>> this, or save the wget output to a file and check if the file size is
>> zero or something if you need it to be more robust.
>>
>> cheers
>> Jeff
>>
>>
>> #!/bin/bash
>>
>> OLDMD5SUM="$(cat md5sum.old)"
>> NEWMD5SUM="$(wget -q - http://myurl.com | md5sum)"
>>
>> if ! [ "$OLDMD5SUM" = "$NEWMD5SUM" ]
>> then
>> echo "$NEWMD5SUM" > md5sum.old
>> echo "http://myurl.com modified on $(date)" | mail -s
>> "http://myurl.com modified!" me at mydomain.com
>> fi
>>
>>
>> _______________________________________________
>> Tucson Free Unix Group - tfug at tfug.org
>> Subscription Options:
>> http://www.tfug.org/mailman/listinfo/tfug_tfug.org
>>
>>
> I have written a Perl script that does this. It is highly configurable
> and simple to use. I will send it to you off list.
>
Sounds useful! How about putting it on a webpage somewhere under the GPL? :)
Andy
--
Andy
PGP Key ID: 0xDC1B5864
More information about the tfug
mailing list