#!/usr/bin/perl %handled = (); open (F, "< notify.cache"); $cnt = 0; while () { chomp; $handled{$_} = 1; s/&diff=\d+&/&/; $handled{$_} = 1; $cnt++; } open (F, "lynx -dump http://nemerle.org/Special:Recentchanges |"); @queue = (); $need = 0; while () { /^\s*\d+\. (http:\/\/nemerle\.org\/wiki\/index.php\?title=.*diff=\d.*)$/ or next; my ($c,$c2) = ($1,$1); $c =~ s/&diff=\d+&/&/; if ($handled{$c2} == 1 or $handled{$c} == 1) {} else { $need = 1; push @queue, $c2; $handled{$c2} = 1; } } exit unless $need; $cont = ""; foreach $f (@queue) { open (F, "wget -q -O - '$f' |"); $copy = 0; while () { // and last; if ($copy) { /
/ and last; } s/]*class='diff')/$1 style='font-size: 10px;' /; $cont .= $_ if ($copy); /
/ and $copy = 1; } } $date = localtime; $time = time; open (SM, "| /usr/sbin/sendmail -f feedback\@nemerle.org -t"); print SM < Date: $date From: Wiki auto notifier To: feedback\@nemerle.org Subject: changes in wiki [$cnt] Mime-Version: 1.0 Content-Type: text/html; charset=utf8 Content-Transfer-Encoding: 8bit Content-Disposition: inline $cont EOF ; close(SM) or die; open(F, ">> notify.cache"); foreach $f (@queue) { print F "$f\n"; } close(F);