* Import keyanalyze into signing-party. Thanks to Matthew Wilcox for the
[pgp-tools.git] / keyanalyze / scripts / top50.pl
1 #!/usr/bin/perl
2 # this short script is for making the HTML for the top50 report monthly
3 # Copyright (c)2001 M. Drew Streib
4 # This code is released under the GPL version 2 or later.
5
6 # NOTE: this is designed to be run one directory up, from analyze.sh
7
8 while ($line = <STDIN>) {
9 $line =~ /\s+(\d+)\s+((\w|\d)+)\s+((\w|\d)+)\s+((\d|\.)+)/;
10 $rank = $1;
11 $key0 = $2;
12 $key = $4;
13 $msd = $6;
14 $command = 'wget -O - -q "http://pgp.dtype.org:11371/pks/lookup?search=0x'
15 .$key.'&op=index"';
16 $wget = `$command`;
17 $command = 'grep "'.$key.'" scripts/top50comments.txt';
18 $rawcomments = `$command`;
19 if (!($wget =~ /\d\d\d\d\/\d\d\/\d\d (.*)( \&lt.*)\n/)) {
20 $wget =~ /\d\d\d\d\/\d\d\/\d\d (.*)/;
21 $name = $1;
22 }
23 else {
24 $name = $1;
25 }
26 if ($rawcomments) {
27 $rawcomments =~ /(\w|\d)+\s(.*)/;
28 $comments = $2;
29 } else {
30 $comments = '';
31 }
32 print "<TR><TD>$rank</TD><TD><A href=\"http://pgp.dtype.org:11371/pks/lookup?search=0x$key\&op=vindex\">$key</A></TD><TD>$name</TD><TD><I>$comments</I></TD><TD align=\"right\">$msd</TD></TR>\n";
33 }