X-Git-Url: https://git.donarmstrong.com/?p=infobot.git;a=blobdiff_plain;f=scripts%2Firclog2html.pl;fp=scripts%2Firclog2html.pl;h=ad7cb1b2034b4dbe097b71edd69fa77e6ccfed17;hp=c2affbeeee494e182bc1cec5338ac95e0c0aa81c;hb=a9d992a562cbb003f0f3ee4af8a5d0166abdedf9;hpb=17f601b2d588fc3f6694051b09097b647ec42a52
diff --git a/scripts/irclog2html.pl b/scripts/irclog2html.pl
index c2affbe..ad7cb1b 100755
--- a/scripts/irclog2html.pl
+++ b/scripts/irclog2html.pl
@@ -34,9 +34,9 @@ use POSIX qw(strftime);
# Comment out the "table" assignment to use the plain version
-#my $STYLE = "tt";
-#my $STYLE = "simplett";
-#my $STYLE = "table";
+#my $STYLE = "tt";
+#my $STYLE = "simplett";
+#my $STYLE = "table";
my $STYLE = "simpletable";
my $colour_left = "#000099"; # nick leaving channel
@@ -62,10 +62,10 @@ sub header {
qq{
- irclog2html for $channel on $date
-
-
-
+ irclog2html for $channel on $date
+
+
+
irclog2html for $channel on $date
@@ -284,14 +284,32 @@ sub main {
# new nick
$nickcount++;
- # if we've exceeded our estimate of the number of nicks, double it
+ # if we've exceeded our estimate of the number of nicks, double it
$NICKMAX *= 2 if $nickcount >= $NICKMAX;
$htmlcolour = $colour_nick{$nick} =
html_rgb( $nickcount, $NICKMAX );
}
- output_timenicktext( $date, $time, $channel, $nick, $text,
- $htmlcolour );
+ output_timenicktext( $date, $time, $channel, $nick, $text, $htmlcolour );
+ }
+ elsif ( $line =~ /^\* ([^ \/]+)\/(\#[^ ]+) (.+)/ ) {
+ # Colourise the /me's #
+ $nick=$1;
+ $channel=$2;
+ $text="$3";
+ $htmlcolour = $colour_nick{$nick};
+ if ( !defined($htmlcolour) ) {
+
+ # new nick
+ $nickcount++;
+
+ # if we've exceeded our estimate of the number of nicks, double it
+ $NICKMAX *= 2 if $nickcount >= $NICKMAX;
+
+ $htmlcolour = $colour_nick{$nick} =
+ html_rgb( $nickcount, $NICKMAX );
+ }
+ output_timenicktext( $date, $time, $channel, $nick, $text, $htmlcolour );
}
elsif ( $line =~ /^>\;>\;>\; / ) {
$line =~ s/^>\;>\;>\; /\*\*\* /;
@@ -309,8 +327,7 @@ sub main {
$colour_nick{$nick_new} = $colour_nick{$nick_old};
$colour_nick{$nick_old} = undef;
- $line =~
-s/(\*\*\* .*)/$1<\/font>/;
+ $line =~ s/(\*\*\* .*)/$1<\/font>/;
}
elsif ( $line =~ /\*\*\* (join|mode|topic)\/(.*?) .*/ ) {
$channel = lc $2;