#!/afs/athena/contrib/perl/p

$/ = "\n\n";

while(<>){
    s/URL: (.+)//;
    $url = $1;

    s/Title: (.+)//;
    $title{$url} = $1;

    s/Headers: (.+)//;
    $headers{$url} = $1;

    (@stuff) = split("----------", $_);
    (@more) = split("\n", $stuff[$#stuff]);
    $links{$url} = $more[2];
    $depth{$url} = $more[3];
    $markup{$url} = $more[4];
    print "$title{$url} $headers{$url}\n$url\n\n";
}
exit;
print("Beginning analysis\n");
@toplinks = sort {$links{$a} <=> $links{$b};} keys %links;
@topmarkup = sort {$markup{$a} <=> $markup{$b};} keys %links;

for $url (@toplinks){
    print("$links{$url} $title{$url} ($url)\n");
}
print("-" x 40, "\n");
for $url (@topmarkup){
    print("$markup{$url} $title{$url} ($url)\n");
}

