#!/usr/bin/perl # enter your perlbot logs directory here $directory = 'logs/'; #a perl script to search through irc logfiles #and display occurences of specific words use CGI qw/-compile :standard :html3 :netscape/; opendir(DIRLIST, $directory); DIRTO: foreach $diritem (readdir(DIRLIST)) { if (-d "$directory$diritem") { if ($diritem =~ /(\.\.?|^msg$)/) { next DIRTO } push @channels, $diritem; } } closedir(DIRLIST); print header; print start_html(-bgcolor=>'white',-text=>'black',-title=>'IRC log search',-style=>'A:link {text-decoration: none}'), img({-src=>'../logsearch.jpg'}), start_form, '
| What words would you like to search for: | ', textfield('words'), ' |
| In which channel do you want to search: | ', popup_menu(-name=>'channel', -values=>\@channels, -default=>$channels[0]), ' |
| ', submit, ' |
";
foreach(@lines) {
s/(\d+:\d+:\d+)/$1<\/A>/;
print;
}
print "";
}
}
closedir(DIR);
print br, hr;
}
print br, 'Return to browsing the logs';
print end_html;