7 use HTML
::TreeBuilder
::XPath
;
12 GetOptions
(\
%OPT, "cred=s");
14 my($searchurl) = @ARGV;
19 e.g. http://search.cpan.org/~rgarcia/perl-5.9.5/
23 die Usage
unless $searchurl;
34 open my $fh, "/home/ftp/pub/PAUSE/modules/06perms.txt" or die;
42 my($lmod,$luser,$perms) = split /,/, $_;
43 next unless $lmod eq $mod;
44 next if $perms eq "c";
49 my $ua = LWP
::UserAgent
->new;
50 my $resp = $ua->get($searchurl);
51 die $resp->as_string unless $resp->is_success;
52 my $tree = HTML
::TreeBuilder
::XPath
->new_from_content($resp->content);
53 my @h2 = $tree->findnodes("//h2");
56 next unless $h2->findvalue(".") =~ /Modules/;
57 my($table) = $h2->findnodes("../table");
58 my @rows = $table->findnodes(".//tr");
60 my($td3) = $row->findnodes("./td[3]");
61 next unless $td3->findvalue(".") =~ /UNAUTHORIZED/;
62 my($td1) = $row->findnodes("./td[1]");
63 my $td1_string = $td1->findvalue(".");
64 my $module = trim
$td1_string;
65 my $owner = find_owner
($module);
66 printf "%-45s %-12s\n", $module, $owner;