-# NOTE: this is designed to be run one directory up, from analyze.sh
-
-while ($line = <STDIN>) {
- $line =~ /\s+(\d+)\s+((\w|\d)+)\s+((\w|\d)+)\s+((\d|\.)+)/;
- $rank = $1;
- $key0 = $2;
- $key = $4;
- $msd = $6;
- $command = 'wget -O - -q "http://pgp.dtype.org:11371/pks/lookup?search=0x'
- .$key.'&op=index"';
- $wget = `$command`;
- $command = 'grep "'.$key.'" scripts/top50comments.txt';
- $rawcomments = `$command`;
- if (!($wget =~ /\d\d\d\d\/\d\d\/\d\d (.*)( \<.*)\n/)) {
- $wget =~ /\d\d\d\d\/\d\d\/\d\d (.*)/;
- $name = $1;
- }
- else {
- $name = $1;
+# 2004-09-14: modifications by Christoph Berg <cb@df7cb.de>:
+# * use perl to read top50comments.txt
+# * use gpg --list-key instead of wget
+# * use strict & warnings
+
+# 2008-07-18: modifications by Christoph Berg <cb@df7cb.de>:
+# * directly read msd.txt instead of a -sorted variant
+
+use strict;
+use Getopt::Std;
+
+#my $keyserver = "http://pks.gpg.cz:11371/pks/lookup?op=vindex&fingerprint=on&search=0x";
+#my $keyserver = "http://keyserver.noreply.org/pks/lookup?op=index&fingerprint=on&search=0x";
+my $keyserver = "http://subkeys.pgp.net:11371/pks/lookup?op=index&fingerprint=on&search=0x";
+my %options;
+getopts('c:k:n:', \%options);
+my $comments = $options{c} || "top50comments.txt";
+my $keyring = $options{k} ? "--no-default-keyring --keyring=$options{k}" : "";
+my $top = $options{n} || 50;
+
+my %comment;
+if (open F, $comments) {
+ while(<F>) {
+ die "$comments.$.: syntax error" unless /([\dA-F]+)\b ?(.*)/;
+ $comment{$1} = $2;