# Simple alias and timer hook to post updated statistics in a HTML file, # for inclusion on the web. # # This code is in the public domain. # @www.stats.last = [ ] alias www.stats { # www.stats # if ([$0]==[]) { echo *** Missing file name for www.stats! } { @www.stats.tmp = [ $N $S $A ] if ([$(www.stats.tmp)]!=[$(www.stats.last)]) { @www.stats.last = [$(www.stats.tmp)] ^exec -name wwwstats cat > $(0).new ^msg %wwwstats $N on $S @$Z if ([$A]!=[]) { ^msg %wwwstats , away
$A } ^exec -close %wwwstats timer 2 ^exec mv -f $(0).new $(0) } } } ^on #-timer 15 "*" {^www.stats ~/www/html/irc-stats.html} echo *** Loaded www-stats.irc