Monitor your university's emergency webpage (or any page) for changes. You can use this, for example, to check for the addition of snow cancellation data. If there is a change, audibly let it be known.
#!/usr/bin/perl -w
use strict;
use LWP::Simple;
use Digest::MD5;
use constant 'PAGE' => 'http://www.rowan.edu/emergency/';
my $d = Digest::MD5->new();
my $data = get(PAGE);
$d->add($data);
my $original = $d->digest;
print "Monitoring " . PAGE . "\n";
while(sleep(60*5)){
print "getting page...\n";
$data = get(PAGE);
my $d = Digest::MD5->new();
$d->add($data);
my $latest = $d->digest;
if($latest ne $original){
use Win32::OLE qw( EVENTS );
my $DirectSS = new Win32::OLE( "{EEE78591-FE22-11D0-8BEF-00600
+81841DE}" ) or die "$!";
my $say = "The watched page eventually boils. Your page has ch
+anged.";
print "Page has been updated!!!\n";
$DirectSS->Speak($say);
while( $DirectSS->{Speaking} ){
Win32::OLE->SpinMessageLoop();
Win32::Sleep( 100 );
}
exit;
}
print "no change.\n";
}
Quick and dirty script. Comments and questions encouraged. See a bug? Let me know!
John J Reiser
newrisedesigns.com