#!/usr/bin/perl -w use strict; use Data::Dumper; my $key; my %datacompsoc = (); my %nickjoins = (); my $rank = 1; my $total = 0; my $others =""; # Open stats data file from statbot.pl open (FILE, "< datacompsoc"); # or die "can't open statsdata: $!"; { undef $/; # read in file all at once eval ; # recreate $datacompsoc } #die "can't recreate nick data from statsdata: $@" if $@; close FILE; #or die "can't close statsdata: $!"; # Open nickjoin file my $nick = ""; my $join = ""; my $line = ""; open (FILE, "< nickjoin-compsoc"); # or die "can't open nickjoin: $!"; { while (my $file = ) { chomp $file; foreach $line (split /^/, $file) { $line =~ s/\n//g; ($nick, $join) = split /:/, $line; $nickjoins{$nick} = $join; } } } close FILE; # Print HTML print < #compsoc line stats

#compsoc line stats

Top 100 Nicks

EOF ; my $nicktotal = 0; foreach $key (sort {$datacompsoc{$b} <=> $datacompsoc{$a}} keys %datacompsoc) { if ($rank < 101) { if (exists $nickjoins{$key}) { $nicktotal = 0; foreach $nick (split /,/, $nickjoins{$key}) { if (exists $datacompsoc{$nick}) { $nicktotal = $nicktotal + $datacompsoc{$nick}; } } $nicktotal = $nicktotal + $datacompsoc{$key}; print " \n \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; } else { print " \n \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; } } elsif ($rank > 100) { $others = $others . $key . " "; } $rank++; $total = $total + $datacompsoc{$key}; } print <
Rank Nick Lines Nickjoins
$rank$key$datacompsoc{$key}$nicktotal$nickjoins{$key}
$rank$key$datacompsoc{$key}
Total $total

...and the others

$others

EOF ; print < EOF ;