#!/usr/bin/perl -w use strict; use Getopt::Long; # pisg - Perl IRC Statistics Generator # # Copyright (C) 2001 - morten@wtf.dk # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA my ($channel, $logfile, $format, $network, $outputfile, $maintainer, $pagehead, $usersfile, $imagepath, $logdir, $lang, $bgcolor, $text, $hbgcolor, $hcolor, $hicell, $hicell2, $tdcolor, $tdtop, $link, $vlink, $hlink, $headline, $rankc, $minquote, $maxquote, $activenicks, $activenicks2, $topichistory, $pic1, $pic2, $nicktracking, $timeoffset, $version, $debug, $debugfile); # Values that _MUST_ be set below (unless you pass them on commandline) $channel = "#channel"; # The name of your channel. $logfile = "channel.log"; # The exact filename of the logfile $format = "mIRC"; # logfile format. see FORMATS file $network = "SomeIRCNet"; # Network the channels is using. $outputfile = "index.html"; # The name of the html file to be generated $maintainer = "MAINTAINER"; # The maintainer or bot which makes the logfile $pagehead = "none"; # Some 'page header' file which you want to # include in top of the stats $usersfile = "users.cfg"; # Path to users config file (aliases, ignores, # pics and more, see users.cfg for examples) $imagepath = ""; # If your user pictures is located # some special directory, set the path here. $logdir = ""; # If you specify a path to a dir here, then # pisg will take that dir, and parse ALL # logfiles in it, and create 1 HTML file # from it $lang = 'EN'; # Language to use: # EN | DE | DK | FR | ES | PL # Here you can set the colors for your stats page.. $bgcolor = "#dedeee"; # Background color of the page $text = "black"; # Normal text color $hbgcolor = "#666699"; # Background color in headlines $hcolor = "white"; # Text color in headline $hicell = "#BABADD"; # Background color in highlighted cells $hicell2 = "#CCCCCC"; # Background color in highlighted cells $tdcolor = "black"; # Color of text in tables $tdtop = "#C8C8DD"; # Top color in some tables. $link = "#0b407a"; # Color of links $vlink = "#0b407a"; # Color of visited links $hlink = "#0b407a"; # Color of hovered links $headline = "#000000"; # Border color of headlines $rankc = "#CCCCCC"; # Colors of 'ranks' (1,2,3,4) $pic1 = "pipe-blue.png"; # Bar-graphic-file for normal times $pic2 = "pipe-purple.png"; # Bar-graphic-file for top-times # Other things that you might set, but not everyone cares about them $minquote = "25"; # Minimal value of letters for a random quote $maxquote = "65"; # Maximum value of letters for a random quote $activenicks = "25"; # Number of nicks to show in the 'top 25' $activenicks2 = "30"; # Nicks to show in 'these didnt make it...' $topichistory = "3"; # How many topics to show in 'latest topics' $nicktracking = 0; # Track nickchanges and create aliases (can # be slow, so it's disabled by default) $timeoffset = "+0"; # A time offset on the stats page - if your # country has a different timezone than the # machine where the stats are being # generated, then for example do +1 # to add 1 hour to the time # You shouldn't care about anything below this point $debug = 0; # 0 = Debugging off, 1 = Debugging on $debugfile = "debug.log"; # Path to debug file(must be set if $debug == 1) $version = "v0.17-cvs"; my ($lines, $kicked, $gotkicked, $smile, $longlines, $time, $timestamp, %alias, $normalline, $actionline, $thirdline, @ignore, $line, $processtime, @topics, %monologue, %kicked, %gotkick, %line, %length, %qpercent, %lpercent, %sadface, %smile, $nicks, %longlines, %mono, %times, %question, %loud, $totallength, %gaveop, %tookop, %joins, %actions, %sayings, %wordcount, %lastused, $colorcode, $boldcode, $underlinecode, $reversecode, $plaincode, %gotban, %setban, %foul, $days, $oldtime, $lastline, $actions, $normals, %userpics, %userlinks, %T, $repeated, $lastnormal); sub main { init_pisg(); # Init commandline arguments and other things init_lineformats(); # Attempt to set line formats in compliance with user specification (--format) init_users_config(); # Init users config. (Aliases, ignores etc.) init_debug(); # Init the debugging file if ($logdir) { parse_dir(); # Run through all logfiles in dir } else { parse_file($logfile); # Run through the whole logfile } create_html(); # Create the HTML # (look here if you want to remove some of the # stats which you don't care about) close_debug(); # Close the debugging file print "\nFile was parsed succesfully in $processtime on $time.\n"; } sub init_pisg { print "pisg $version - Perl IRC Statistics Generator\n\n"; get_cmdlineoptions(); $timestamp = time; if ($timeoffset =~ /\+(\d+)/) { # We must plus some hours to the time $timestamp += 3600 * $1; # 3600 seconds per hour } elsif ($timeoffset =~ /-(\d+)/) { # We must remove some hours from the time $timestamp -= 3600 * $1; # 3600 seconds per hour } # Set useful values. $days = 1; $oldtime = "00"; $lastline = ""; $actions = "0"; $normals = "0"; $boldcode = chr(2); $colorcode = chr(3); $plaincode = chr(15); $reversecode = chr(22); $underlinecode = chr(31); $time = localtime($timestamp); $repeated = 0; $lastnormal = ""; print "Statistics for channel $channel \@ $network by $maintainer\n\n"; print "Using language template: $lang\n\n" if ($lang ne 'EN'); } sub init_lineformats { # These are the regular expressions which matches the lines in the logfile, # and looks different if it's xchat, mIRC or whatever. # If you want to add support for a new format - you first have to add the # regex here, and then you also have to modify the parse subroutines called # 'parse_normalline()', 'parse_actionline()' and 'parse_thirdline()' if ($format eq 'xchat') { $normalline = '^(\d+):\d+:\d+ <([^>]+)>\s+(.*)'; $actionline = '^(\d+):\d+:\d+ \*\s+(\S+) (.*)'; $thirdline = '^(\d+):(\d+):\d+ .--\s+(\S+) (\S+) (\S+) (\S+) (\S+) (\S+) (.*)'; } elsif ($format eq 'mIRC') { $normalline = '^\[(\d+):\d+\] <([^>]+)> (.*)'; $actionline = '^\[(\d+):\d+\] \* (\S+) (.*)'; $thirdline = '^\[(\d+):(\d+)\] \*\*\* (\S+) (\S+) (\S+) (\S+) (\S+)(.*)'; } elsif ($format eq 'eggdrop') { $normalline = '^\[(\d+):\d+\] <([^>]+)> (.*)'; $actionline = '^\[(\d+):\d+\] Action: (\S+) (.*)'; $thirdline = '^\[(\d+):(\d+)\] (\S+) (\S+) (\S+) (\S+)(.*)'; } elsif ($format eq 'bxlog') { $normalline = '^\[\d+ \w+\/(\d+):\d+\] <([^>]+)> (.*)'; $actionline = '^\[\d+ \w+\/(\d+):\d+\] \* (\S+) (.*)'; $thirdline = '^\[\d+ \w+\/(\d+):(\d+)\] \S (\S+) (\S+) (\S+) (\S+) (\S+) (\S+) (\S+) (.*)'; } elsif ($format eq 'grufti') { $normalline = '^\[(\d+):\d+\] <([^>]+)> (.*)'; $actionline = '^\[(\d+):\d+\] \* (\S+) (.*)'; $thirdline = '^\[(\d+):(\d+)\] (\S+) (\S+) (\S+) (\S+) (\S+) (\S+)(.*)'; } else { die("Logfile format not supported, check \$format setting.\n"); } } sub init_users_config { if (open(USERS, $usersfile)) { my $lineno = 0; while () { $lineno++; my $line = $_; next if /^#/; if ($line =~ //) { my $nick; if ($line =~ /nick="([^"]+)"/) { $nick = $1; } else { print STDERR "Warning: no nick specified in $usersfile on line $lineno\n"; next; } if ($line =~ /alias="([^"]+)"/) { my @thisalias = split(/\s+/, $1); push(@{ $alias{$nick} }, @thisalias); } if ($line =~ /pic="([^"]+)"/) { $userpics{$nick} = $1; } if ($line =~ /link="([^"]+)"/) { $userlinks{$nick} = $1; } if ($line =~ /ignore="Y"/i) { push(@ignore, $nick); } } } close(USERS); } } sub init_debug { if ($debug) { print "[ Debugging => $debugfile ]\n"; open(DEBUG,"> $debugfile") or print STDERR "$0: Unable to open debug file($debugfile): $!\n"; debug("*** pisg debug file for $logfile\n"); } } sub parse_dir { print "Going into $logdir and parsing all files there...\n\n"; my $files = `ls $logdir`; my @filesarray = split(/\n/, $files); # Add trailing slash when it's not there.. if (substr($logdir, -1) ne '/') { $logdir =~ s/(.*)/$1\//; } foreach my $file (@filesarray) { $file = $logdir . $file; parse_file($file); } } sub parse_file { my $file = shift; # This parses the file.. print "Analyzing log($file) in '$format' format...\n"; open (LOGFILE, $file) or die("$0: Unable to open logfile($file): $!\n"); while($line = ) { $lines++; # Increment number of lines. # Strip mIRC color codes $line =~ s/$colorcode\d{1,2},\d{1,2}//g; $line =~ s/$colorcode\d{0,2}//g; # Strip mIRC bold, plain, reverse and underline codes $line =~ s/[$boldcode$underlinecode$reversecode$plaincode]//g; my $hashref; # Match normal lines. if ($hashref = parse_normalline($line)) { my ($hour, $nick, $saying, $i); for ($i = 0; $i <= $repeated; $i++) { if ($i > 0) { $hashref = parse_normalline($lastnormal); $lines++; #Increment number of lines for repeated lines } $hour = $hashref->{hour}; $nick = find_alias($hashref->{nick}); $saying = $hashref->{saying}; # Timestamp collecting $times{$hour}++; unless (grep /^\Q$nick\E$/i, @ignore) { $normals++; $line{$nick}++; # Count up monologues if ($lastline eq $nick) { $mono{$nick}++; if ($mono{$nick} == "5") { $monologue{$nick}++; $mono{$nick} = 0; } } else { $mono{$nick} = 0; } $lastline = $nick; my $l = length($saying); if ($l > $minquote && $l < $maxquote) { $saying = htmlentities($saying); # Creates $hash{nick}[n] - a hash of an array. push (@{ $sayings{$nick} }, $saying); $longlines{$nick}++; } $question{$nick}++ if ($saying =~ /\?/); $loud{$nick}++ if ($saying =~ /!/); $foul{$nick}++ if ($saying =~ /ass|fuck|bitch|shit|scheisse|scheiße|kacke|arsch|ficker|ficken|schlampe/); # Who smiles the most? # A regex matching al lot of smilies $smile{$nick}++ if ($saying =~ /[8;:=][ ^-o]?[)pPD}\]>]/); $sadface{$nick}++ if ($saying =~ /[8;:=][ ^-]?[\(\[\\\/{]/); # Don't count http:// as a :/ face $sadface{$nick}-- if ($saying =~ /\w+:\/\//); foreach my $word (split(/[\s,!?.:;)(]+/, $saying)) { # remove uninteresting words next unless (length($word) > 5); # ignore contractions next if ($word =~ m/'..?$/); $wordcount{$word}++ unless (grep /^\Q$word\E$/i, @ignore); $lastused{$word} = $nick; } $length{$nick} += $l; $totallength += $l; } } $lastnormal = $line; $repeated = 0; } # Match action lines. elsif ($hashref = parse_actionline($line)) { my ($hour, $nick, $saying); $hour = $hashref->{hour}; $nick = find_alias($hashref->{nick}); $saying = $hashref->{saying}; # Timestamp collecting $times{$hour}++; unless (grep /^\Q$nick\E$/i, @ignore) { $actions++; $line{$nick}++; my $len = length($saying); $length{$nick} += $len; $totallength += $len; } } # Match *** lines. elsif ($hashref = parse_thirdline($line)) { my ($hour, $min, $nick, $kicker, $newtopic, $newmode, $newjoin, $newnick); $hour = $hashref->{hour}; $min = $hashref->{min}; $nick = find_alias($hashref->{nick}); $kicker = $hashref->{kicker}; $newtopic = $hashref->{newtopic}; $newmode = $hashref->{newmode}; $newjoin = $hashref->{newjoin}; $newnick = $hashref->{newnick}; # Timestamp collecting $times{$hour}++; unless (grep /^\Q$nick\E$/i, @ignore) { if (defined($kicker)) { unless (grep /^\Q$kicker\E$/i, @ignore) { $gotkick{$nick}++; $kicked{$kicker}++; } } elsif (defined($newtopic)) { my $tcount = @topics; $topics[$tcount]{topic} = htmlentities($newtopic); $topics[$tcount]{nick} = $nick; $topics[$tcount]{hour} = $hour; $topics[$tcount]{min} = $min; # Strip off the quotes (') $topics[$tcount]{topic} =~ s/^\'(.*)\'$/$1/; } elsif (defined($newmode)) { my @opchange = opchanges($newmode); unless (exists $gaveop{$nick}) { $gaveop{$nick} = 0 } $gaveop{$nick} += $opchange[0] if $opchange[0]; $tookop{$nick} += $opchange[1] if $opchange[1]; } elsif (defined($newjoin)) { $joins{$nick}++; } elsif (defined($newnick) && ($nicktracking == 1)) { if (find_alias($newnick) eq $newnick) { if (defined($alias{$nick}) && !defined($alias{$newnick})) { push (@{$alias{$nick}}, $newnick); } elsif (defined($alias{$newnick}) && !defined($alias{$nick})) { push (@{$alias{$newnick}}, $nick); } elsif ($nick =~ /Guest/) { push (@{$alias{$newnick}}, ($newnick, $nick)); } else { push (@{$alias{$nick}}, ($nick, $newnick)); } } } } if ($hour < $oldtime) { $days++ } $oldtime = $hour; } } close(LOGFILE); my ($sec,$min,$hour) = gmtime(time - $^T); $processtime = sprintf("%02d hours, %02d minutes and %02d seconds", $hour, $min, $sec); $nicks = scalar keys %line; print "Finished analyzing log, $days days total.\n"; } # Here is the 3 parse sub routines, their function is to return a hash with # the elements in the line. This is where we add the format dependent stuff. sub parse_normalline { # Parse a normal line - returns a hash with 'hour', 'nick' and 'saying' my $line = shift; my %hash; if ($line =~ /$normalline/) { debug("[$lines] Normal: $1 $2 $3"); if (($format eq 'mIRC') || ($format eq 'xchat') || ($format eq 'eggdrop') || ($format eq 'bxlog') || ($format eq 'grufti')) { $hash{hour} = $1; $hash{nick} = $2; $hash{saying} = $3; } else { die("Format not supported?!\n"); } return \%hash; } else { return; } } sub parse_actionline { # Parse an action line - returns a hash with 'hour', 'nick' and 'saying' my $line = shift; my %hash; if ($line =~ /$actionline/) { debug("[$lines] Action: $1 $2 $3"); if (($format eq 'mIRC') || ($format eq 'xchat') || ($format eq 'eggdrop') || $format eq 'bxlog' || ($format eq 'grufti')) { $hash{hour} = $1; $hash{nick} = $2; $hash{saying} = $3; } else { die("Format not supported?!\n"); } return \%hash; } else { return; } } sub parse_thirdline { # Parses the 'third' line - (the third line is everything else, like # topic changes, mode changes, kicks, etc.) # parse_thirdline() have to return a hash with the following keys, for # every format: # hour - the hour we're in (for timestamp loggin) # min - the minute we're in (for timestamp loggin) # nick - the nick # kicker - the nick which were kicked (if any) # newtopic - the new topic (if any) # newmode - a deop or an op, must be '+o' or '-o' # newjoin - a new nick which has joined the channel # newnick - a person has changed nick and this is the new nick my $line = shift; my %hash; if ($line =~ /$thirdline/) { if ($7) { debug("[$lines] ***: $1 $2 $3 $4 $5 $6 $7"); } else { debug("[$lines] ***: $1 $2 $3 $4 $5 $6"); } if ($format eq 'mIRC') { $hash{hour} = $1; $hash{min} = $2; $hash{nick} = $3; if (($4.$5) eq 'waskicked') { $hash{kicker} = $7; } elsif (($4.$5) eq 'changestopic') { $hash{newtopic} = "$7 $8"; } elsif (($4.$5) eq 'setsmode:') { $hash{newmode} = $6; } elsif (($4.$5) eq 'hasjoined') { $hash{newjoin} = $3; } elsif (($4.$5) eq 'nowknown') { $hash{newnick} = $8; } } elsif ($format eq 'xchat') { $hash{hour} = $1; $hash{min} = $2; $hash{nick} = $3; if (($4.$5) eq 'haskicked') { $hash{kicker} = $3; $hash{nick} = $6; } elsif (($4.$5) eq 'haschanged') { $hash{newtopic} = $9; } elsif (($4.$5) eq 'giveschannel') { $hash{newmode} = '+o'; } elsif (($4.$5) eq 'removeschannel') { $hash{newmode} = '-o'; } elsif (($5.$6) eq 'hasjoined') { $hash{newjoin} = $1; } elsif (($5.$6) eq 'nowknown') { $hash{newnick} = $8; } } elsif ($format eq 'eggdrop') { $hash{hour} = $1; $hash{min} = $2; $hash{nick} = $3; if (($4.$5) eq 'kickedfrom') { $7 =~ /^ by ([\S]+):.*/; $hash{kicker} = $1; } elsif ($3 eq 'Topic') { $7 =~ /^ by ([\S]+)![\S]+: (.*)/; $hash{nick} = $1; $hash{newtopic} = $2; } elsif (($4.$5) eq 'modechange') { $hash{newmode} = $6; $7 =~ /^ .+ by ([\S]+)!.*/; $hash{nick} = $1; $hash{newmode} =~ s/^\'//; } elsif ($5 eq 'joined') { $hash{newjoin} = $3; } elsif (($3.$4) eq 'Nickchange:') { $hash{nick} = $5; $7 =~ /([\S]+)/; $hash{newnick} = $1; } elsif (($3.$4.$5) eq 'Lastmessagerepeated') { $repeated = $6; } } elsif ($format eq 'bxlog') { $hash{hour} = $1; $hash{min} = $2; $hash{nick} = $3; if ($5 eq 'kicked') { $hash{kicker} = $9; $hash{kicker} =~ s/!.*$//; } elsif ($3 eq 'Topic') { $hash{nick} = substr($5, 0, -1); $hash{newtopic} = "$6 $7 $8 $9 $10"; } elsif ($5 eq '[+o') { $hash{newmode} = '+o'; $hash{newmode} = substr($6, 0, -1); } elsif ($5 eq '[-o') { $hash{newmode} = '-o'; $hash{newmode} = substr($6, 0, -1); } elsif (($4.$5) eq 'hasjoined') { $hash{newjoin} = $1; } elsif (($4.$5) eq 'isknown') { $hash{newnick} = $6; } $hash{nick} =~ s/!.*$//; } elsif ($format eq 'grufti') { $hash{hour} = $1; $hash{min} = $2; $hash{nick} = $3; if ($5 eq 'kicked') { $hash{kicker} = $3; $hash{nick} = $6; } elsif (($4.$5) eq 'haschanged') { $hash{newtopic} = $9; } elsif (($4.$5) eq 'modechange') { $hash{newmode} = substr($6, 1); $hash{nick} = substr($9, 1); } elsif ($5 eq 'joined') { $hash{newjoin} = $1; } elsif (($3.$4) eq 'Nickchange') { $hash{nick} = $7; $hash{newnick} = $9; } } else { die("Format not supported?!\n"); } return \%hash; } else { return; } } sub opchanges { my @modes = split(//, $_[0]); my ($mode,$plus) = ("",0); my ($gaveop,$tookop) = (0,0); foreach (@modes) { if (/^\+$/) { $plus = 1; next; } elsif (/^-$/) { $plus = 0; next; } else { next unless /^o$/ } if ($plus) { $gaveop++ } else { $tookop++ } } my @out = ($gaveop,$tookop); return @out; } sub htmlentities { my $str = shift; $str =~ s/\&/\&/g; $str =~ s/\/\>/g; return $str; } sub html { my $html = shift; print OUTPUT $html . "\n"; } sub template_text { # This function is for the homemade template system. It receives a name # of a template and a hash with the fields in the template to update to # its corresponding value my $template = shift; my %hash = @_; my $text; if (!$T{$lang}{$template}) { # Fall back to English if the language template doesn't exist $text = $T{EN}{$template}; } $text = $T{$lang}{$template}; if (!$text) { die("No such template $template\n"); } foreach my $key (sort keys %hash) { $text =~ s/\[:$key\]/$hash{$key}/; $text =~ s/ü/ü/g; $text =~ s/ö/ö/g; $text =~ s/ä/ä/g; $text =~ s/ß/ß/g; $text =~ s/å/å/g; $text =~ s/æ/æ/g; $text =~ s/ø/ø/g; } return $text; } sub replace_links { # Sub to replace urls and e-mail addys to links my $str = shift; my $nick = shift; if ($nick) { $str =~ s/(http|https|ftp|telnet|news)(:\/\/[-a-zA-Z0-9_]+.[-a-zA-Z0-9.,_~=:;&@%?#\/+]+)/$nick<\/a>/g; $str =~ s/([-a-zA-Z0-9._]+@[-a-zA-Z0-9_]+.[-a-zA-Z0-9._]+)/$nick<\/a>/g; } else { $str =~ s/(http|https|ftp|telnet|news)(:\/\/[-a-zA-Z0-9_]+.[-a-zA-Z0-9.,_~=:;&@%?#\/+]+)/$1$2<\/a>/g; $str =~ s/([-a-zA-Z0-9._]+@[-a-zA-Z0-9_]+.[-a-zA-Z0-9._]+)/$1<\/a>/g; } return $str; } sub debug { if ($debug) { my $debugline = $_[0] . "\n"; print DEBUG $debugline; } } sub find_alias { my $nick = shift; foreach (keys %alias) { return $_ if (grep /^\Q$nick\E$/i, @{$alias{$_}}); } return $nick; } sub create_html { # This is where all subroutines get executed, you can actually design # your own layout here, the lines should be self-explainable print "Now generating HTML($outputfile)...\n"; open (OUTPUT, "> $outputfile") or die("$0: Unable to open outputfile($outputfile): $!\n"); htmlheader(); pageheader(); activetimes(); activenicks(); headline(template_text('bignumtopic')); html("\n"); # Needed for sections questions(); loudpeople(); mostsmiles(); mostsad(); longlines(); shortlines(); html("
"); # Needed for sections mostusedword(); mostreferenced(); headline(template_text('othernumtopic')); html("\n"); # Needed for sections gotkicks(); mostkicks(); mostop(); mostmonologues(); mostjoins(); mostfoul(); html("
"); # Needed for sections headline(template_text('latesttopic')); html("\n"); # Needed for sections lasttopics(); html("
"); # Needed for sections my %hash = ( lines => $lines ); html(template_text('totallines', %hash) . "

"); htmlfooter(); close(OUTPUT); } sub activetimes { # The most actives times on the channel my (%output, $tbgcolor); &headline(template_text('activetimestopic')); my @toptime = sort { $times{$b} <=> $times{$a} } keys %times; my $highest_value = $times{$toptime[0]}; my @now = localtime($timestamp); my $image; for my $hour (sort keys %times) { debug("Time: $hour => ". $times{$hour}); if ($toptime[0] == $hour) { $image = $pic2; } else { $image = $pic1; } my $size = ($times{$hour} / $highest_value) * 100; my $percent = ($times{$hour} / $lines) * 100; $percent =~ s/(\.\d)\d+/$1/; if ($timeoffset =~ /\+(\d+)/) { # We must plus some hours to the time $hour += $1; $hour = $hour % 24; if ($hour < 10) { $hour = "0" . $hour; } } elsif ($timeoffset =~ /-(\d+)/) { # We must remove some hours from the time $hour -= $1; $hour = $hour % 24; if ($hour < 10) { $hour = "0" . $hour; } } $output{$hour} = "$percent%
\"$percent\"\n"; } html("\n"); for ($b = 0; $b < 24; $b++) { if ($b < 10) { $a = "0" . $b; } else { $a = $b; } if (!defined($output{$a}) || $output{$a} eq "") { html(""); } else { html($output{$a}); } } html(""); for ($b = 0; $b < 24; $b++) { if ($now[2] == $b) { $tbgcolor = "\#AAAAAA"; } else { $tbgcolor = "\#CCCCCC"; } html(""); } html("
0%
$b
"); } sub activenicks { # The most active nicks (those who wrote most lines) my $randomline; &headline(template_text('activenickstopic')); html(""); html(""); if (%userpics) { html(""); } html(""); my @active = sort { $line{$b} <=> $line{$a} } keys %line; if ($activenicks > $nicks) { $activenicks = $nicks; print "Note: There was less nicks in the logfile than your specificied there to be in most active nicks...\n"; } my ($nick, $visiblenick); my $i = 1; for (my $c = 0; $c < $activenicks; $c++) { $nick = $active[$c]; $visiblenick = $active[$c]; if (!$longlines{$nick}) { $randomline = ""; } else { my $rand = rand($longlines{$nick}); $randomline = $sayings{$nick}[$rand]; } # Convert URLs and e-mail addys to links $randomline = replace_links($randomline); # Add a link to the nick if there is any if ($userlinks{$nick}) { $visiblenick = replace_links($userlinks{$nick}, $nick); } my $h = $hicell; $h =~ s/^#//; $h = hex $h; my $h2 = $hicell2; $h2 =~ s/^#//; $h2 = hex $h2; my $f_b = $h & 0xff; my $f_g = ($h & 0xff00) >> 8; my $f_r = ($h & 0xff0000) >> 16; my $t_b = $h2 & 0xff; my $t_g = ($h2 & 0xff00) >> 8; my $t_r = ($h2 & 0xff0000) >> 16; my $col_b = sprintf "%0.2x", abs int(((($t_b - $f_b) / $activenicks) * +$c) + $f_b); my $col_g = sprintf "%0.2x", abs int(((($t_g - $f_g) / $activenicks) * +$c) + $f_g); my $col_r = sprintf "%0.2x", abs int(((($t_r - $f_r) / $activenicks) * +$c) + $f_r); html(""); if ($userpics{$nick}) { html(""); } html(""); $i++; } html("
 " . template_text('nick') . "" . template_text('numberlines') ."". template_text('randquote') ."" . template_text('userpic') ."
"); my $line = $line{$nick}; html("$i$visiblenick$line"); html("\"$randomline\"

"); # ALMOST AS ACTIVE NICKS @active = sort { $line{$b} <=> $line{$a} } keys %line; my $nickstoshow = $activenicks + $activenicks2; unless ($nickstoshow > $nicks) { html("
" . template_text('nottop') . ""); for (my $c = $activenicks; $c < $nickstoshow; $c++) { unless ($c % 5) { unless ($c == $activenicks) { html(""); } } html(""); } html("
"); my $nick = $active[$c]; my $lines = $line{$nick}; html("$nick ($lines)
"); } } sub mostusedword { # Lao the infamous word usage statistics my %usages; foreach my $word (sort keys %wordcount) { next if exists $line{$word}; $usages{$word} = $wordcount{$word}; } my @popular = sort { $usages{$b} <=> $usages{$a} } keys %usages; if (@popular) { &headline(template_text('mostwordstopic')); html(""); html(""); html(""); html(""); for(my $i = 0; $i < 10; $i++) { last unless $i < $#popular; my $a = $i + 1; my $popular = $popular[$i]; my $wordcount = $wordcount{$popular[$i]}; my $lastused = $lastused{$popular[$i]}; html(""); html(""); html(""); html(""); } html("
 " . template_text('word') . "" . template_text('numberuses') . "" . template_text('lastused') . "
$a"); html("$popular$wordcount$lastused
"); } } sub mostreferenced { my %usages; foreach my $word (sort keys %wordcount) { next unless exists $line{$word}; $usages{$word} = $wordcount{$word}; } my @popular = sort { $usages{$b} <=> $usages{$a} } keys %usages; if (@popular) { &headline(template_text('referencetopic')); html(""); html(""); html(""); html(""); for(my $i = 0; $i < 5; $i++) { last unless $i < $#popular; my $a = $i + 1; my $popular = $popular[$i]; my $wordcount = $wordcount{$popular[$i]}; my $lastused = $lastused{$popular[$i]}; html(""); html(""); html(""); html(""); } html("
 " . template_text('nick') . "" . template_text('numberuses') . "" . template_text('lastused') . "
$a"); html("$popular$wordcount$lastused
"); } } sub questions { # Persons who asked the most questions foreach my $nick (sort keys %question) { if ($line{$nick} > 100) { $qpercent{$nick} = ($question{$nick} / $line{$nick}) * 100; $qpercent{$nick} =~ s/(\.\d)\d+/$1/; } } my @question = sort { $qpercent{$b} <=> $qpercent{$a} } keys %qpercent; if (@question) { my %hash = ( nick => $question[0], per => $qpercent{$question[0]} ); my $text = template_text('question1', %hash); html("$text"); if (@question >= 2) { my %hash = ( nick => $question[1], per => $qpercent{$question[1]} ); my $text = template_text('question2', %hash); html("
$text"); } html(""); } else { html("" . template_text('question3') . ""); } } sub loudpeople { # The ones who speak LOUDLY! foreach my $nick (sort keys %loud) { if ($line{$nick} > 100) { $lpercent{$nick} = ($loud{$nick} / $line{$nick}) * 100; $lpercent{$nick} =~ s/(\.\d)\d+/$1/; } } my @loud = sort { $lpercent{$b} <=> $lpercent{$a} } keys %lpercent; if (@loud) { my %hash = ( nick => $loud[0], per => $lpercent{$loud[0]} ); my $text = template_text('loud1', %hash); html("$text"); if (@loud >= 2) { my %hash = ( nick => $loud[1], per => $lpercent{$loud[1]} ); my $text = template_text('loud2', %hash); html("
$text"); } html(""); } else { my $text = template_text('loud3'); html("$text"); } } sub gotkicks { # The persons who got kicked the most my @gotkick = sort { $gotkick{$b} <=> $gotkick{$a} } keys %gotkick; if (@gotkick) { my %hash = ( nick => $gotkick[0], kicks => $gotkick{$gotkick[0]} ); my $text = template_text('gotkick1', %hash); html("$text"); if (@gotkick >= 2) { my %hash = ( nick => $gotkick[1], kicks => $gotkick{$gotkick[1]} ); my $text = template_text('gotkick2', %hash); html("
$text"); } html(""); } } sub mostjoins { my @joins = sort { $joins{$b} <=> $joins{$a} } keys %joins; if (@joins) { my %hash = ( nick => $joins[0], joins => $joins{$joins[0]} ); my $text = template_text('joins', %hash); html("$text"); } } sub mostkicks { # The person who got kicked the most my @kicked = sort { $kicked{$b} <=> $kicked{$a} } keys %kicked; if (@kicked) { my %hash = ( nick => $kicked[0], kicked => $kicked{$kicked[0]} ); my $text = template_text('kick1', %hash); html("$text"); if (@kicked >= 2) { my %hash = ( oldnick => $kicked[0], nick => $kicked[1], kicked => $kicked{$kicked[1]} ); my $text = template_text('kick2', %hash); html("
$text"); } html(""); } else { my $text = template_text('kick3'); html("$text"); } } sub mostmonologues { # The person who had the most monologues (speaking to himself) my @monologue = sort { $monologue{$b} <=> $monologue{$a} } keys %monologue; if (@monologue) { my %hash = ( nick => $monologue[0], monos => $monologue{$monologue[0]} ); my $text = template_text('mono1', %hash); html("$text"); if (@monologue >= 2) { my %hash = ( nick => $monologue[1], monos => $monologue{$monologue[1]} ); my $text = template_text('mono2', %hash); html("
$text"); } html(""); } } sub longlines { my %len; # The person(s) who wrote the longest lines foreach my $nick (sort keys %length) { if ($line{$nick} > 100) { $len{$nick} = $length{$nick} / $line{$nick}; $len{$nick} =~ s/(\.\d)\d+/$1/; } } my @len = sort { $len{$b} <=> $len{$a} } keys %len; my $all_lines = $normals + $actions; my $totalaverage; if ($all_lines > 0) { $totalaverage = $totallength / $all_lines; $totalaverage =~ s/(\.\d)\d+/$1/; } if (@len) { my %hash = ( nick => $len[0], letters => $len{$len[0]} ); my $text = template_text('long1', %hash); html("$text
"); if (@len >= 2) { %hash = ( channel => $channel, avg => $totalaverage ); $text = template_text('long2', %hash); html("$text"); } } } sub shortlines { # This sub should be combined with the longlines sub at some point.. it # does basically the same thing. my %len; # The person(s) who wrote the shortest lines foreach my $nick (sort keys %length) { if ($line{$nick} > 5) { $len{$nick} = $length{$nick} / $line{$nick}; $len{$nick} =~ s/(\.\d)\d+/$1/; } } my @len = sort { $len{$a} <=> $len{$b} } keys %len; if (@len) { my %hash = ( nick => $len[0], letters => $len{$len[0]} ); my $text = template_text('short1', %hash); html("$text
"); if (@len >= 2) { %hash = ( nick => $len[1], letters => $len{$len[1]} ); $text = template_text('short2', %hash); html("$text"); } } } sub mostfoul { my %spercent; foreach my $nick (sort keys %foul) { if ($line{$nick} > 15) { $spercent{$nick} = ($foul{$nick} / $line{$nick}) * 100; $spercent{$nick} =~ s/(\.\d)\d+/$1/; } } my @foul = sort { $spercent{$b} <=> $spercent{$a} } keys %spercent; if (@foul) { my %hash = ( nick => $foul[0], per => $spercent{$foul[0]} ); my $text = template_text('foul1', %hash); html("$text"); if (@foul >= 2) { my %hash = ( nick => $foul[1], per => $spercent{$foul[1]} ); my $text = template_text('foul2', %hash); html("
$text"); } html(""); } else { my %hash = ( channel => $channel ); my $text = template_text('foul3', %hash); html("$text"); } } sub mostsad { my %spercent; foreach my $nick (sort keys %sadface) { if ($line{$nick} > 100) { $spercent{$nick} = ($sadface{$nick} / $line{$nick}) * 100; $spercent{$nick} =~ s/(\.\d)\d+/$1/; } } my @sadface = sort { $spercent{$b} <=> $spercent{$a} } keys %spercent; if (@sadface) { my %hash = ( nick => $sadface[0], per => $spercent{$sadface[0]} ); my $text = template_text('sad1', %hash); html("$text"); if (@sadface >= 2) { my %hash = ( nick => $sadface[1], per => $spercent{$sadface[1]} ); my $text = template_text('sad2', %hash); html("
$text"); } html(""); } else { my %hash = ( channel => $channel ); my $text = template_text('sad3', %hash); html("$text"); } } sub mostop { my @ops = sort { $gaveop{$b} <=> $gaveop{$a} } keys %gaveop; my @deops = sort { $tookop{$b} <=> $tookop{$a} } keys %tookop; if (@ops) { my %hash = ( nick => $ops[0], ops => $gaveop{$ops[0]} ); my $text = template_text('mostop1', %hash); html("$text"); if (@ops >= 2) { my %hash = ( nick => $ops[1], ops => $gaveop{$ops[1]} ); my $text = template_text('mostop2', %hash); html("
$text"); } html(""); } else { my %hash = ( channel => $channel ); my $text = template_text('mostop3', %hash); html("$text"); } if (@deops) { my %hash = ( channel => $channel, nick => $deops[0], deops => $tookop{$deops[0]} ); my $text = template_text('mostdeop1', %hash); html("$text"); if (@deops >= 2) { my %hash = ( nick => $deops[1], deops => $tookop{$deops[1]} ); my $text = template_text('mostdeop2', %hash); html("
$text"); } html(""); } else { my %hash = ( channel => $channel ); my $text = template_text('mostdeop3', %hash); html("$text"); } } sub mostsmiles { # The person(s) who smiled the most :-) my %spercent; foreach my $nick (sort keys %smile) { if ($line{$nick} > 100) { $spercent{$nick} = ($smile{$nick} / $line{$nick}) * 100; $spercent{$nick} =~ s/(\.\d)\d+/$1/; } } my @smiles = sort { $spercent{$b} <=> $spercent{$a} } keys %spercent; if (@smiles) { my %hash = ( nick => $smiles[0], per => $spercent{$smiles[0]} ); my $text = template_text('smiles1', %hash); html("$text"); if (@smiles >= 2) { my %hash = ( nick => $smiles[1], per => $spercent{$smiles[1]} ); my $text = template_text('smiles2', %hash); html("
$text"); } html(""); } else { my %hash = ( channel => $channel ); my $text = template_text('smiles3', %hash); html("$text"); } } sub lasttopics { debug("Total number of topics: ". scalar @topics); if (@topics) { my $ltopic = @topics - 1; my $tlimit = 0; $topichistory -= 1; if ($ltopic > $topichistory) { $tlimit = $ltopic - $topichistory; } for (my $i = $ltopic; $i >= $tlimit; $i--) { $topics[$i]{"topic"} = replace_links($topics[$i]{"topic"}); my $topic = $topics[$i]{topic}; my $nick = $topics[$i]{nick}; my $hour = $topics[$i]{hour}; my $min = $topics[$i]{min}; html("$topic"); html("By $nick at $hour:$min"); } } else { html("" . template_text('notopic') .""); } } # Some HTML subs sub htmlheader { print OUTPUT < $channel @ $network channel statistics
HTML my %hash = ( channel => $channel, network => $network, maintainer => $maintainer, time => $time, days => $days, nicks => $nicks, channel => $channel ); print OUTPUT "" . template_text('pagetitle1', %hash) . "
"; print OUTPUT "
" . template_text('pagetitle2', %hash) . "
"; print OUTPUT template_text('pagetitle3', %hash) . "

"; } sub htmlfooter { print OUTPUT < Stats generated by
pisg $version
pisg by Morten "LostStar" Brix Pedersen and others
Stats generated in $processtime
HTML } sub headline { my ($title) = @_; print OUTPUT <
$title
HTML } sub pageheader { if ($pagehead ne 'none') { open(PAGEHEAD, $pagehead) or die("$0: Unable to open $pagehead for reading: $!\n"); while () { html($_); } } } sub close_debug { if ($debug) { close(DEBUG) or print STDERR "$0: Cannot close debugfile($debugfile): $!\n"; } } sub get_cmdlineoptions { my $tmp; # Commandline options my $help; my $usage = < \$channel, 'logfile=s' => \$logfile, 'format=s' => \$format, 'network=s' => \$network, 'maintainer=s' => \$maintainer, 'outfile=s' => \$outputfile, 'dir=s' => \$logdir, 'ignorefile=s' => \$tmp, 'aliasfile=s' => \$tmp, 'usersfile=s' => \$usersfile, 'help|?' => \$help ) == 0 or $help) { die($usage); } if (@ARGV) { if ($ARGV[0]) { $channel = $ARGV[0]; } if ($ARGV[1]) { $logfile = $ARGV[1]; } if ($ARGV[2]) { $outputfile = $ARGV[2]; } if ($ARGV[3]) { $maintainer = $ARGV[3]; } } if ($tmp) { die("The aliasfile and ignorefile has been obsoleted by the new userscfg, please use that instead [look in users.cfg]\n"); } } ### English $T{EN}{mostop1} = "[:nick] donated [:ops] ops in the channel..."; $T{EN}{mostop2} = "[:nick] was also very polite: [:ops] from her/him"; $T{EN}{mostop3} = "Strange, no op was given on [:channel]!"; $T{EN}{mostdeop1} = "[:nick] is the channel sheriff with [:deops] deops..."; $T{EN}{mostdeop2} = "[:nick] deoped [:deops] users"; $T{EN}{mostdeop3} = "Wow, no op was taken on [:channel]!"; $T{EN}{question1} = "[:nick] is either stupid or just making many questions... [:per]% lines contained a question!"; $T{EN}{question2} = "[:nick] didn't know that much either, [:per]% of his lines were questions"; $T{EN}{question3} = "Nobody asked questions here, just geniuses at this channel?"; $T{EN}{loud1} = "Loudest one was [:nick] who yelled [:per]% of the time!"; $T{EN}{loud2} = "Another old yeller was [:nick] who shouted [:per]% of the time!"; $T{EN}{loud3} = "Nobody raised an exclamation mark, wow."; $T{EN}{gotkick1} = "[:nick] wasn't very popular, got kicked [:kicks] times!"; $T{EN}{gotkick2} = "[:nick] seemed to be hated too, [:kicks] kicks were received"; $T{EN}{joins} = "[:nick] couldn't decide to stay or to go, [:joins] joins during this reporting period!"; $T{EN}{kick1} = "[:nick] is insane or just a fair op, kicked a total of [:kicked] people!"; $T{EN}{kick2} = "[:oldnick]'s faithfull follower, [:nick], kicked about [:kicked] people"; $T{EN}{kick3} = "Nice oppers here, no one got kicked!"; $T{EN}{mono1} = "[:nick] is talking to himself a lot, wrote over 5 lines in a row [:monos] times!"; $T{EN}{mono2} = "Another lonely one was [:nick], who managed to hit [:monos] times"; $T{EN}{long1} = "[:nick] wrote longest lines, average of [:letters] per line..."; $T{EN}{long2} = "Channel average on [:channel] was [:avg] letters per line"; $T{EN}{short1} = "[:nick] wrote shortest lines, average of [:letters] per line..."; $T{EN}{short2} = "[:nick] was tight-lipped, too, averaging [:letters]"; $T{EN}{foul1} = "[:nick] has quite a potty mouth, [:per]% lines contained foul language"; $T{EN}{foul2} = "[:nick] also makes sailors blush, [:per]% of the time"; $T{EN}{foul3} = "Nobody is foul-mouthed at [:channel]! Get out much?"; $T{EN}{smiles1} = "[:nick] brings happiness to the world, [:per]% lines contained smiling faces :)"; $T{EN}{smiles2} = "[:nick] isn't a sad person either, who smiled [:per]% of the time"; $T{EN}{smiles3} = "Nobody smiles at [:channel]! Cheer up guys and girls."; $T{EN}{sad1} = "[:nick] seems to be sad at the moment, [:per]% lines contained sad faces :("; $T{EN}{sad2} = "[:nick] is also a sad person, who cried [:per]% of the time"; $T{EN}{sad3} = "Nobody is sad at [:channel]! What a happy channel :-)"; $T{EN}{notopic} = "A topic was never set on this channel"; ## Topics $T{EN}{bignumtopic} = "Big numbers"; $T{EN}{othernumtopic} = "Other interesting numbers"; $T{EN}{latesttopic} = "Latest Topics"; $T{EN}{activetimestopic} = "Most active times"; $T{EN}{activenickstopic} = "Most active nicks"; $T{EN}{mostwordstopic} = "Most used words"; $T{EN}{referencetopic} = "Most referenced nick"; ## Other text $T{EN}{totallines} = "Total number of lines: [:lines]"; $T{EN}{nick} = "Nick"; $T{EN}{numberlines} = "Number of lines"; $T{EN}{randquote} = "Random quote"; $T{EN}{userpic} = "Userpic"; $T{EN}{nottop} = "These didn't make it to the top:"; $T{EN}{word} = "Word"; $T{EN}{numberuses} = "Number of Uses"; $T{EN}{lastused} = "Last Used by"; $T{EN}{pagetitle1} = "[:channel] @ [:network] stats by [:maintainer]"; $T{EN}{pagetitle2} = "Statistics generated on [:time]"; $T{EN}{pagetitle3} = "During this [:days]\-days reporting period, a total number of [:nicks] different nicks were represented on [:channel]."; ### German $T{DE}{mostop1} = "[:nick] vergab [:ops] ops im Channel..."; $T{DE}{mostop2} = "[:nick] war auch sehr zuvorkommend: [:ops] von ihm/ihr"; $T{DE}{mostop3} = "Komisch, kein op wurde in [:channel] vergeben!"; $T{DE}{mostdeop1} = "[:nick] ist die Channel-Polizei. Er/Sie hat [:deops] Usern das @ wieder weggenommen..."; $T{DE}{mostdeop2} = "[:nick] nahm [:deops] Usern das @ wieder weg."; $T{DE}{mostdeop3} = "Wow, niemand wurde deopped in [:channel]!"; $T{DE}{question1} = "[:nick] hat wohl in der Schule nicht gut aufgepasst... [:per]% seiner Zeilen enthielten eine Frage!"; $T{DE}{question2} = "[:nick] weiss wohl auch nicht viel, [:per]% seiner Zeilen waren Fragen"; $T{DE}{question3} = "Niemand hat hier was gefragt, sollte das etwa ein Channel voller Genies sein? ;)"; $T{DE}{loud1} = "Am lautesten war [:nick] der [:per]% der Zeit geschrieen hat!"; $T{DE}{loud2} = "Ein anderer Schreihals war [:nick] der/die [:per]% der Zeit rumgeschrieen hat!"; $T{DE}{loud3} = "Niemand hat ein Ausrufungszeichen benutzt, wow... Zurückhaltende User im Channel ;)"; $T{DE}{gotkick1} = "[:nick] war wohl der Channelclown, er/sie wurde [:kicks] mal gekickt!"; $T{DE}{gotkick2} = "[:nick] konnte sich scheinbar auch nicht benehmen, [:kicks] kicks für ihn/sie"; $T{DE}{joins} = "[:nick] konnte sich nicht entscheiden im Channel zu bleiben oder zu gehen, [:joins] joins während des Statistik-Zeitraums!"; $T{DE}{kick1} = "Ist [:nick] jetzt einfach nur ein fairer Op oder macht ihm/ihr das Spass? Er/Sie kickte [:kicked] User!"; $T{DE}{kick2} = "[:oldnick]'s würdiger Nachfolger, [:nick], er/sie kickte [:kicked] User"; $T{DE}{kick3} = "Nette Opper hier, niemand wurde gekickt!"; $T{DE}{mono1} = "[:nick] spricht viel mit sich selbst, er/sie schrieb über 5 Zeilen in einer Reihe und das [:monos] mal!"; $T{DE}{mono2} = "Ein anderes einsames Herz ist [:nick], der/die [:monos] mal mit sich selbst redete"; $T{DE}{long1} = "[:nick] ist die Labertasche im Channel Er/Sie schrieb die längste Zeile mit durchschnittlich [:letters] Buchstaben pro Zeile..."; $T{DE}{long2} = "Channel-Durchschnitt in [:channel] war [:avg] Buchstaben pro Zeile"; $T{DE}{short1} = "[:nick] ist nicht sehr Mitteilungsbedürftig. Er/Sie schrieb die kürzeste Zeile mit durchschnittlich [:letters] Buchstaben pro Zeile..."; $T{DE}{short2} = "[:nick] war auch sehr kurzfassend, durchschnittlich [:letters] Buchstaben pro Zeile"; $T{DE}{foul1} = "[:nick] hat in seiner/ihrer Jugend keine Erziehung genossen, [:per]% seiner/ihrer Sätze enthielten Schimpfworte!"; $T{DE}{foul2} = "[:nick] war [:per]% der Zeit unartig (Ob da der Weihnachtsman noch kommt?)"; $T{DE}{foul3} = "Alle gut erzogen in [:channel], niemand hat Schimpfworte benutzt!"; $T{DE}{smiles1} = "[:nick] ist ein fröhlicher Mensch, [:per]% seiner/ihrer Zeilen enthielt ein fröhliches Smily :)"; $T{DE}{smiles2} = "[:nick] scheint auch glücklich zu sein. Er/Sie \"smilte\" [:per]% der Zeit"; $T{DE}{smiles3} = "Niemand \"smilte\" in [:channel]! Los Leute legt mal wieder ein Lächeln auf :)"; $T{DE}{sad1} = "[:nick] scheint im Moment nicht gut drauf zu sein, [:per]% seiner/ihrer Zeilen enthielten ein trauriges Smily :("; $T{DE}{sad2} = "[:nick] ist auch eine traurige Person, die [:per]% der Zeit geweint hat"; $T{DE}{sad3} = "Niemand ist traurig in [:channel]! Was für ein fröhlicher Channel :)"; $T{DE}{notopic} = "In diesem Channel wurde kein Topic gesetzt"; ## Topics $T{DE}{bignumtopic} = "Die Zahlen sprechen für sich :)"; $T{DE}{othernumtopic} = "Andere interessante Zahlen"; $T{DE}{latesttopic} = "Letzte Topics"; $T{DE}{activetimestopic} = "Wann war am meisten los?"; $T{DE}{activenickstopic} = "Wer quatscht am meisten?"; $T{DE}{mostwordstopic} = "Am meisten benutzte Wörter"; $T{DE}{referencetopic} = "Begehrte Nicks :)"; ## Other text $T{DE}{totallines} = "Gesamtanzahl der Zeilen: [:lines]"; $T{DE}{nick} = "Nick"; $T{DE}{numberlines} = "Anzahl der Zeilen"; $T{DE}{randquote} = "Zufalls quote"; $T{DE}{userpic} = "Userbild"; $T{DE}{nottop} = "Sie haben es nicht an die Spitze geschafft:"; $T{DE}{word} = "Wort"; $T{DE}{numberuses} = "Wie oft benutzt"; $T{DE}{lastused} = "Zuletzt benutzt von"; $T{DE}{pagetitle1} = "[:channel] @ [:network] stats erstellt von [:maintainer]"; $T{DE}{pagetitle2} = "Statistik erstellt am [:time]"; $T{DE}{pagetitle3} = "Während des Statistikzeitraums von [:days] Tage(n) wurden [:nicks] verschiedene Nicks in [:channel] gezählt."; ### Danish $T{DK}{mostop1} = "[:nick] gav [:ops] op status i kanalen..."; $T{DK}{mostop2} = "[:nick] var også venlig at gi': [:ops] fra sig"; $T{DK}{mostop3} = "Underligt, ingen har fået op på [:channel] endnu!"; $T{DK}{mostdeop1} = "[:nick] holder orden på [:channel] med [:deops] deops..."; $T{DK}{mostdeop2} = "[:nick] deoppede [:deops] brugere"; $T{DK}{mostdeop3} = "Hmm, der var ingen som fik op på [:channel]!"; $T{DK}{question1} = "[:nick] må være rimelig dum eller efterligner bare Spørge-Jørgen... [:per]% af hans linjer var spørgsmål!"; $T{DK}{question2} = "[:nick] var heller ingen Einstein, [:per]% af hans linjer var også spørgsmål"; $T{DK}{question3} = "Ingen spørgsmål på denne kanal. De må sørme være kloge!"; $T{DK}{loud1} = "Den mest larmende var [:nick], som råbte [:per]% af tiden!"; $T{DK}{loud2} = "En anden skrigehals var [:nick], som råbte [:per]% af tiden!"; $T{DK}{loud3} = "Der er ingen som råber. Leger de stilleleg?"; $T{DK}{gotkick1} = "[:nick] er ret upopulær, blev sparket ud [:kicks] gange!"; $T{DK}{gotkick2} = "[:nick] er heller ikke nogen Elvis, [:kicks] gange fik han sparket"; $T{DK}{joins} = "[:nick] er lidt forvirret. Han har været inde og ude af kanalen [:joins] gange!"; $T{DK}{kick1} = "[:nick] er magtsygt eller ved hvordan han/hun skal kontrollere sine fjender. Han har sparket [:kicked] folk ud af kanalen!"; $T{DK}{kick2} = "[:oldnick] har en efterfølger. [:nick] sparkede [:kicked] folk ud af kanalen"; $T{DK}{kick3} = "Venlige operatører må man sige. Ingen har fået sparket!"; $T{DK}{mono1} = "[:nick] snakker meget med sig selv. Han har skrevet over 5 linjer på en gang, [:monos] gange!"; $T{DK}{mono2} = "En anden ensom person var [:nick], som snakkede til sig selv [:monos] gange"; $T{DK}{long1} = "[:nick] skriver meget lange sætninger. Gennemsnittet er [:letters] bogstaver pr. linje..."; $T{DK}{long2} = "Gennemsnittet på [:channel] er [:avg] bogstaver pr. linje"; $T{DK}{short1} = "[:nick] skrev de korteste linjer. Gennemsnittet er [:letters] bogstaver pr. linje..."; $T{DK}{short2} = "[:nick] skriver også korte linjer, med et gennesnit på [:letters]"; $T{DK}{foul1} = "[:nick] er lidt stor i munden, [:per]% af linjerne indholte uhøfligt sprog"; $T{DK}{foul2} = "[:nick] burde også vaske munden med sæbe med at det han fyrer af, [:per]% af tiden"; $T{DK}{foul3} = "Ingen rapkæftede på [:channel]!"; $T{DK}{smiles1} = "[:nick] er altid glad, [:per]% af linjerne havde glade ansigter :)"; $T{DK}{smiles2} = "[:nick] er heller ikke en trist person, som smilede [:per]% af tiden"; $T{DK}{smiles3} = "Ingen smiler på [:channel]! Op med humøret drenge og piger."; $T{DK}{sad1} = "[:nick] er meget ked af det for tiden, [:per]% af linjerne havde sørgelige ansigter :("; $T{DK}{sad2} = "[:nick] er også en trist person, som græd [:per]% af tiden"; $T{DK}{sad3} = "Ingen er kede af det på [:channel]! Sikke en glad kanal :-)"; $T{DK}{notopic} = "A topic was never set on this channel"; ## Topics $T{DK}{bignumtopic} = "Store numre"; $T{DK}{othernumtopic} = "Andre interessante numre"; $T{DK}{latesttopic} = "Sidst nyeste topics"; $T{DK}{activetimestopic} = "Mest aktive tider"; $T{DK}{activenickstopic} = "Mest aktive nicks"; $T{DK}{mostwordstopic} = "Mest brugte ord"; $T{DK}{referencetopic} = "Mest tiltalte nicks"; ## Other text $T{DK}{totallines} = "Hele antal linjer: [:lines]"; $T{DK}{nick} = "Nick"; $T{DK}{numberlines} = "Antal linjer"; $T{DK}{randquote} = "Tilfældig sætning"; $T{DK}{userpic} = "Brugerbillede"; $T{DK}{nottop} = "Disse nåede ikke til tops:"; $T{DK}{word} = "Ord"; $T{DK}{numberuses} = "Antal forbrug"; $T{DK}{lastused} = "Sidst brugt af"; $T{DK}{pagetitle1} = "[:channel] @ [:network] statistikker af [:maintainer]"; $T{DK}{pagetitle2} = "Statistikker lavet d. [:time]"; $T{DK}{pagetitle3} = "Igennem denne [:days]\-dages periode, har der været [:nicks] forskellige nicks på [:channel]."; ### French # Not exactly the translation but something fun # Time translation needs more update $T{FR}{mostop1} = "[:nick] a donné [:ops] ops sur le channel..."; $T{FR}{mostop2} = "[:nick] est aussi très poli : [:ops] ops de sa part"; $T{FR}{mostop3} = "Etrange, aucun op n'a été donné sur [:channel]!"; $T{FR}{mostdeop1} = "[:nick] est le shérif avec [:deops] deops..."; $T{FR}{mostdeop2} = "[:nick] a deopé [:deops] utilisateurs"; $T{FR}{mostdeop3} = "Wow, aucun op n'a été retiré sur [:channel]!"; $T{FR}{question1} = "[:nick] est soit stupide soit trop curieux... [:per]% de ses lignes contiennent une question!"; $T{FR}{question2} = "[:nick] n'en connait pas davantage, [:per]% de ses lignes étaient des questions"; $T{FR}{question3} = "Personne ne pose de question ici, tous des génies sur ce channel?"; $T{FR}{loud1} = "Le plus bruyant est [:nick] qui gueule [:per]% du temps!"; $T{FR}{loud2} = "Un autre vieux raleur est [:nick] qui braille [:per]% du temps!"; $T{FR}{loud3} = "Personne ne s'exclame ici, wow."; $T{FR}{gotkick1} = "[:nick] n'est pas trés populaire, kické [:kicks] fois!"; $T{FR}{gotkick2} = "[:nick] n'a pas d'ami non plus, [:kicks] kicks reçus"; $T{FR}{joins} = "[:nick] ne sait pas s'il doit rester ou partir, [:joins] visites durant cette période!"; $T{FR}{kick1} = "[:nick] est malade ou alors aime bien jouer, son kick a sévi [:kicked] fois!"; $T{FR}{kick2} = "Un disciple de [:oldnick], [:nick], a kické [:kicked] personnes"; $T{FR}{kick3} = "Les ops sont sympas ici, personne n'a été kické!"; $T{FR}{mono1} = "[:nick] se parle à lui-meme trés souvent, il a écrit plus de 5 lignes d'un coup à [:monos] reprises!"; $T{FR}{mono2} = "Un autre incompris est [:nick], qui a tenté de le dépasser à [:monos] reprises"; $T{FR}{long1} = "[:nick] a écrit les lignes les plus longues, avec en moyenne [:letters] lettres par ligne..."; $T{FR}{long2} = "La moyenne sur [:channel] est de [:avg] lettres par ligne"; $T{FR}{short1} = "[:nick] a écrit les lignes les plus courtes, avec en moyenne [:letters] lettres par ligne..."; $T{FR}{short2} = "[:nick] n'a pas grand chose a dire non plus, en moyenne [:letters]"; $T{FR}{foul1} = "[:nick] a du mal a s'exprimer, [:per]% de ses lignes contiennent des mots incompréhensibles"; $T{FR}{foul2} = "[:nick] parle aussi comme un chartier, [:per]% du temps"; $T{FR}{foul3} = "Personne n'a de problème pour parler sur [:channel]! Pendant combien de temps encore?"; $T{FR}{smiles1} = "[:nick] apporte un peu de gaiété dans le monde, [:per]% de ses lignes contiennent un smiley :)"; $T{FR}{smiles2} = "[:nick] n'est pas triste non plus, il sourit [:per]% du temps"; $T{FR}{smiles3} = "Personne ne sourit sur [:channel]! Allez faites un effort quoi!"; $T{FR}{sad1} = "[:nick] semble un peu triste en ce moment, [:per]% de ses lignes contiennent un smiley :("; $T{FR}{sad2} = "[:nick] est aussi bien triste, il pleure [:per]% du temps"; $T{FR}{sad3} = "Personne n'est triste sur [:channel]! Quel channel merveilleux :-)"; $T{FR}{notopic} = "Il n'y a jamais eu de topic sur ce channel"; ## Topics $T{FR}{bignumtopic} = "Les gros chiffres"; $T{FR}{othernumtopic} = "D'autres chiffres intéressants"; $T{FR}{latesttopic} = "Les derniers topics"; $T{FR}{activetimestopic} = "Les périodes d'intense activité"; $T{FR}{activenickstopic} = "Les nicks les plus actifs"; $T{FR}{mostwordstopic} = "Les mots les plus utilisés"; $T{FR}{referencetopic} = "Les mots les plus utilisés dans la conversation"; ## Other text $T{FR}{totallines} = "Nombre total de lignes: [:lines]"; $T{FR}{nick} = "Nick"; $T{FR}{numberlines} = "Nombre de lignes"; $T{FR}{randquote} = "Citation typique"; $T{FR}{userpic} = "Image"; $T{FR}{nottop} = "Ne sont pas dans le classement"; $T{FR}{word} = "Mot"; $T{FR}{numberuses} = "Nombre d'occurences"; $T{FR}{lastused} = "Dernière utilisation par"; $T{FR}{pagetitle1} = "[:channel] @ [:network] stats par [:maintainer]"; $T{FR}{pagetitle2} = "Statistiques générées le [:time]"; $T{FR}{pagetitle3} = "Durant cette periode de [:days] jours, [:nicks] nicks différents sont apparus sur [:channel]."; ### Spanish $T{ES}{mostop1} = "[:nick] ha dado [:ops] ops en el canal..."; $T{ES}{mostop2} = "[:nick] también reparte ensaimadas: [:ops] nada menos"; $T{ES}{mostop3} = "Es raro, pero ningún op ha sido dado en [:channel]!"; $T{ES}{mostdeop1} = "[:nick] es el malo del canal, le ha quitado la @ a [:deops] personas"; $T{ES}{mostdeop2} = "[:nick] le ha quitado la @ a [:deops] personas"; $T{ES}{mostdeop3} = "Increible, pero nadie ha tenido @ en el canal [:channel]!"; $T{ES}{question1} = "[:nick] necesitaba más horas de guardería cuando era pequeño, el [:per]% de sus lineas contienen una pregunta!"; $T{ES}{question2} = "[:nick] tampoco se entera de mucho, el [:per]% de sus lineas son preguntas"; $T{ES}{question3} = "Nadie hace preguntas aquí, esto parece un canal de genios"; $T{ES}{loud1} = "La persona que grita más es [:nick] que escribe con exclamaciones el [:per]% del tiempo!"; $T{ES}{loud2} = "Quien no se queda atrás gritando es [:nick] lo hace el [:per]% del tiempo!"; $T{ES}{loud3} = "Nadie ha escrito frases con exclamaciones."; $T{ES}{gotkick1} = "[:nick] ha sido algo capullo y por eso lo echamos [:kicks] veces!"; $T{ES}{gotkick2} = "[:nick] tambien nos toca bastante las narices, por eso lo echamos [:kicks] veces"; $T{ES}{joins} = "[:nick] no sabe si irse o quedarse, lo he visto [:joins] veces entrando en el canal!"; $T{ES}{kick1} = "[:nick] actua como operador con mano dura, ha echado a [:kicked] personas!"; $T{ES}{kick2} = "[:oldnick] tiene un seguidor aferrimo, [:nick], ha echado a [:kicked] personas"; $T{ES}{kick3} = "Es maja la gente de aquí, nadie ha sido kikeado!"; $T{ES}{mono1} = "[:nick] no tiene amigos, ha escrito más de 5 lineas seguidas en [:monos] ocasiones!"; $T{ES}{mono2} = "Otra persona solitaria es [:nick], que ha echo lo mismo [:monos] veces"; $T{ES}{long1} = "[:nick] escribe más que Cervantes con unas [:letters] letras por linea..."; $T{ES}{long2} = "La media de [:channel] es de [:avg] letras por linea"; $T{ES}{short1} = "[:nick] es la persona más vaga escribiendo, con una media de [:letters] letras por linea..."; $T{ES}{short2} = "[:nick] no se queda atrás, con una media de [:letters]"; $T{ES}{foul1} = "[:nick] necesita que le laven la boca con jabón lagarto, un [:per]% de sus lineas contienen palabrotas y tacos"; $T{ES}{foul2} = "[:nick] tambien es algo bestia, dice tacos el [:per]% del tiempo"; $T{ES}{foul3} = "Parece que todo el mundo habla correctamente en [:channel]! Se desahogan fuera?"; $T{ES}{smiles1} = "[:nick] parece que se hubiera fumado una compresa usada, el [:per]% de sus lineas contienen caritas sonrientes :)"; $T{ES}{smiles2} = "[:nick] habrá fumado otra cosa, está sonriendo el [:per]% del tiempo"; $T{ES}{smiles3} = "Nadie ha sonrreido en [:channel]! Arriba esos animos!!."; $T{ES}{sad1} = "[:nick] parece disgustado, el [:per]% de sus lineas contienen caras tristes :("; $T{ES}{sad2} = "[:nick] tambien está triste el [:per]% del tiempo"; $T{ES}{sad3} = "Nadie está triste en [:channel]! Aquí somos todos felices :-)"; $T{ES}{notopic} = "Nunca se ha utilizado el topic en el canal"; ## Topics $T{ES}{bignumtopic} = "Acerca de nuestra gente"; $T{ES}{othernumtopic} = "Otras cosas interesantes"; $T{ES}{latesttopic} = "Últimos Topics"; $T{ES}{activetimestopic} = "Horas más frecuentadas"; $T{ES}{activenickstopic} = "La gente que más habla"; $T{ES}{mostwordstopic} = "Las palabras más utilizadas"; $T{ES}{referencetopic} = "Las personas de las que más se habla"; ## Other text $T{ES}{totallines} = "Número total de lineas: [:lines]"; $T{ES}{nick} = "Nick"; $T{ES}{numberlines} = "Número de lineas"; $T{ES}{randquote} = "Frase al azar"; $T{ES}{userpic} = "Foto"; $T{ES}{nottop} = "Ellos tambien están, aunque hablan menos:"; $T{ES}{word} = "Palabra"; $T{ES}{numberuses} = "Número de usos"; $T{ES}{lastused} = "Usada por última vez"; $T{ES}{pagetitle1} = "[:channel] @ [:network] estadisticas por [:maintainer]"; $T{ES}{pagetitle2} = "Estadisticas generadas en [:time]"; $T{ES}{pagetitle3} = "Durante los [:days] dias de estadisticas, [:nicks] nicks distintos han pasado por[:channel]."; ### Polish $T{PL}{mostop1} = "[:nick] lubi rozdawac opy, robiac to [:ops] razy..."; $T{PL}{mostop2} = "Milo ze strony [:nick] - zyskuje popularnosc nadajac [:ops] opow."; $T{PL}{mostop3} = "Dziwne, nie dano zadnego opa na [:channel]!"; $T{PL}{mostdeop1} = "[:nick] jest kanalowym szeryfem odbierajac [:deops] opow..."; $T{PL}{mostdeop2} = "[:nick] zdeopowal [:deops] uzytkownikow"; $T{PL}{mostdeop3} = "Wow, zaden op nie zostal odebrany na [:channel]!"; $T{PL}{question1} = "[:nick] jest glupi albo zadaje wiele pytan... [:per]% linii zawieralo pytania!"; $T{PL}{question2} = "[:nick] rowniez nie wie zbyt wiele, [:per]% linii bylo pytaniami"; $T{PL}{question3} = "Nikt o nic nie pyta na kanale - czyzby sami geniusze?"; $T{PL}{loud1} = "Najglosniejszym okazal/a sie [:nick] krzczac przez [:per]% czasu!"; $T{PL}{loud2} = "Kolejnym krzykaczem byl [:nick] ktory wrzeszczal przez [:per]% czasu!"; $T{PL}{loud3} = "Nikt nic nie wykrzykiwal na kanale, wow."; $T{PL}{gotkick1} = "[:nick] nie zalapal o co chodzilo operatorom za pierwszym razem i zostal skopany [:kicks] razy!"; $T{PL}{gotkick2} = "[:nick] nie jest tu chyba zbyt lubiany - wylatywal [:kicks] razy"; $T{PL}{joins} = "[:nick] zastanawial sie nad \"byc albo nie byc\", [:joins] razy wchodzil na kanal!"; $T{PL}{kick1} = "[:nick] jest szalony lub stara sie byc konsekwentny, wykopal [:kicked] osob"; $T{PL}{kick2} = "[:nick] idac w slad za [:oldnick] wykopal [:kicked] osob"; $T{PL}{kick3} = "Mamy tutaj milych operatorow, nikt nie zostal wykopany!"; $T{PL}{mono1} = "[:nick] uwielbia mowic sam do siebie, albo inni za nim nie nadazaja, pisal monologi [:monos] razy!"; $T{PL}{mono2} = "Kolejny samotnikiem okazal sie [:nick], ktory pisal bez towarzystwa [:monos] razy"; $T{PL}{long1} = "[:nick] pisal najdluzsze linie, o sredniej dlugosci [:letters] liter..."; $T{PL}{long2} = "Srednia dla kanalu [:channel] byla [:avg] liter w linii"; $T{PL}{short1} = "[:nick] staral sie pisac zwiezle, srednio [:letters] liter w linii..."; $T{PL}{short2} = "[:nick] wybakiwal krotkie wypowiedzi srednio [:letters]"; $T{PL}{foul1} = "[:nick] ma niewyparzona gebe, [:per]% linii zawieralo bluzgi"; $T{PL}{foul2} = "[:nick] klnie jak szefc (albo i gorzej), przez [:per]% czasu"; $T{PL}{foul3} = "Nikt nie jest klnie na [:channel]! Czesto wychodza?"; $T{PL}{smiles1} = "[:nick] usmiechal sie glupawo, albo byl bardzo szczeliwy bo [:per]% linii zawieralo usmiechniete miny :)"; $T{PL}{smiles2} = "[:nick] mial powody do radosci smiejac sie przez [:per]% czasu spedzonego na kanale"; $T{PL}{smiles3} = "Nikt sie nie usmiechal na [:channel]! Prosze o usmiech panie i panowie."; $T{PL}{sad1} = "[:nick] wyglada na smutna osobe, [:per]% linii zawieralo smutne miny :("; $T{PL}{sad2} = "[:nick] nie czuje sie najlepiej na kanale smucac sie przez [:per]% czasu"; $T{PL}{sad3} = "Nikt nie jest smutny na [:channel]! Coz za szczesliwy kanal :-)"; $T{PL}{notopic} = "Czyzby nigdy nie ustawiono tematu na tym kanale?"; ## Topics $T{PL}{bignumtopic} = "Wielkie liczby"; $T{PL}{othernumtopic} = "Inne interesujace liczby"; $T{PL}{latesttopic} = "Ostatnie tematy"; $T{PL}{activetimestopic} = "Najaktywniejsze pory"; $T{PL}{activenickstopic} = "Najaktywniejsze nicki"; $T{PL}{mostwordstopic} = "Najczesciej uzywane slowa"; $T{PL}{referencetopic} = "Najczesciej wywolywany nick"; ## Other text $T{PL}{totallines} = "Calkowita liczba linii: [:lines]"; $T{PL}{nick} = "Nick"; $T{PL}{numberlines} = "Liczba linii"; $T{PL}{randquote} = "Losowy cytat"; $T{PL}{userpic} = "Userpic"; $T{PL}{nottop} = "Oni nie dostali sie do czolowki:"; $T{PL}{word} = "Wyraz"; $T{PL}{numberuses} = "Liczba uzyc"; $T{PL}{lastused} = "Ostatnio uzywany przez"; $T{PL}{pagetitle1} = "[:channel] @ [:network] stats by [:maintainer]"; $T{PL}{pagetitle2} = "Statystyka wygenerowana [:time]"; $T{PL}{pagetitle3} = "W przedziale [:days]\-dni, [:nicks] roznych nickow odwiedzilo kanal [:channel]."; &main(); # Run the script