#!/afs/athena/contrib/perl5/perl

while(<>){
    if(/Hourly/){
	$inhourly = 1;
    }
    if(/Top Doc/){
	$inhourly = 0;
    }
    if($inhourly){
	if(/^<tr>/){
	    @parts = split("<td>", $_);
	    $hits = $parts[4];
	    $hits =~ s,</td>,,;
	    $max = ($hits > $max) ? $hits:$max;
#	    print "$hits\n" unless !$hits;
	}
    }
    if($ARGV ne $lf){
	$bin[int($max/1000)]++;
	$max = 0;
    }
    $lf = $ARGV;
}

for $n (0..$#bin){
    print "$n\t";
    $ticks = "-" x ($bin[$n]);
    print("$ticks\n");
}
