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


In reply to Let me know if it's gonna snow! by newrisedesigns

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.