#!/usr/bin/perl
#
#licq log to html version 1.0

#Stupid little script to read in licq history files and make a pretty little 
#HTML page out of them

#2000-12-04
#James Terhune <x@terhune.net>
#
# See the fun with ICQ users page! http://terhune.net/content/funwithicq/

#usage:
#log-html.pl < 12345678.history > output.shtml


use strict;

my @log = <STDIN>;
#print "<html><head><title>Title</title></head><body bgcolor=#ffffff text=#000000>\n";
#print "<table><tr><td bgcolor=#000000 colspan=3><font size=5 color=#ffffff>Title goes Here</font></td></tr>\n";
#print "<tr><td bgcolor=#cccccc colspan=3><font size=4 color=#000000>Comments go here</font>\n";

print "<!--#include virtual="/content/funwithicq/stdheader.shtml"-->

foreach my $logg (@log) {
	if ($logg =~ /\:(.*)/) {
		print "$1\n";
	}
	if ($logg =~ /\[ R \| [0-9]{4} \| [0-9]{4} \| [0-9]{4} \| ([0-9]*) \]/) {
		print "</td></tr><tr><td>" . localtime($1) . "</td><td>Human:</td><td bgcolor=#ffcccc>";
	}
	if ($logg =~ /\[ S \| [0-9]{4} \| [0-9]{4} \| [0-9]{4} \| ([0-9]*) \]/) {
		print "</td></tr><tr><td>" . localtime($1) . "</td><td>Bot:</td><td bgcolor=#ccccff>";
	}

}

print "</td></tr></table></body></html>\n\n\n";
#print "</td></tr>";

print "<!--#include virtual="/content/funwithicq/stdfooter.shtml"-->



