A feature-rich, modular AOL Instant Messenger client written chiefly by Bill Atkins and Dan Chokola in their high school days.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

43 lines
802 B

package ForumCheck;
use Milkbone;
use Tk;
use strict;
use HTTP::Lite;
use Digest::MD5;
use constant 'PAGE' => 'http://www.batkins.com/forum/?action=recent';
my ($original, $latest);
register_hook("pre_mainloop", sub {
my $http = new HTTP::Lite;
$http->request(PAGE);
$original = check($http->body());
my $mw = hook("tk_getmain");
$mw->repeat(10 * 1000, \&check);
check();
});
sub get_latest
{
(split /<td colspan="3" bgcolor="#F8F8F8" valign="top" height="40" class="windowbg2">/, shift)[1];
}
sub check
{
my $http = new HTTP::Lite;
$http->request(PAGE);
$latest = get_latest($http->body());
if($latest ne $original and $original ne ""){
hook("error", -short => "New posts in the BATKINS forum.");
$original = $latest;
}
elsif($original eq "")
{
$original = $latest;
}
}
1;