rockbox/www/irc/irclogs.pl
Robert Hak 5522cdf13c correction for irc logs now spanning years
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3368 a1c6a512-1295-4272-9138-f99709370657
2003-03-03 09:26:51 +00:00

52 lines
1.1 KiB
Perl
Executable file

#!/usr/bin/perl
#require "/home/dast/perl/date.pm";
opendir(DIR, ".") or
die "Can't opendir()";
@logs = sort grep { /^rockbox-/ } readdir(DIR);
closedir DIR;
print "<table class=archive>\n";
$lasty = 0;
$lastm = 0;
$count = 0;
for ( @logs ) {
$size = (stat("$_"))[7];
$file = $_;
$log = "";
if (/-(\d+)/) {
if ( $1 =~ /(\d\d\d\d)(\d\d)(\d\d)/ ) {
$y = $1;
$m = $2;
$d = $3;
$mname = $m;
# $mname = ucfirst MonthNameEng($m);
if ($y != $lasty) {
print "</tr><tr>\n" if $lasty != 0;
print "<th>$y</th>\n";
$lasty = $y;
} else {
print "</tr><tr>\n<th></th>" if ( $m != $lastm );
}
if ( $m != $lastm ) {
$count=0;
print "<th>$mname</th>\n";
$lastm = $m;
}
print "<td><a test href=\"$file\">$d</a></td>\n";
if ( ++$count > 15 ) {
print "</tr><tr><th></th><th></th>\n";
$count=0;
}
}
}
}
print "</ul></td></tr></table>\n";