[Tokyo.pm] 首位攻防

h-taguchi @ secom.co.jp h-taguchi @ secom.co.jp
2004年 4月 7日 (水) 20:59:26 CDT


CPANウォッチャーの田口です。(-_ゞ

近年追い上げ著しいSIMONさんがトップに躍り出たようです。
http://www.cpan.org/modules/01modules.index.html

今までちゃんと数えてなかったですが...
このページは、同じモジュールでバージョンのダブリがあって
あんまり芳しくありません。また、SIMONさんが最近リリースした
Maypole::Componentもこのページにはありません。
もっといいページあるんでしょうか?

# Maypoleって気になる...
# Win32::IE::Mechanize、結構いい感じです。

C:>CPANAuth.pl
===> page OK
===> content OK
5659 modules.
1820 authors.

Top 10 heavy authors.
SIMON         67
MIYAGAWA      66
AUTRIJUS      62
MSERGEANT     54
RCLAMP        51
SBURKE        46
XERN          37
ELIZABETH     36
SMUELLER      36
LGODDARD      35


#!/usr/bin/perl
use strict;
use Win32::IE::Mechanize;
use HTML::Parse;
use HTML::FormatText;

my $ie = Win32::IE::Mechanize->new(visible=>1,
	top=>0,
	left=>0,
	height=>600,
	width=>800,
	);

$ie->get("http://www.cpan.org/");
$ie->follow_link(text => "Perl modules");
$ie->follow_link(text => "all modules");
print "===> page OK\n";

my $formatter = HTML::FormatText->new();
my $content = $formatter->format(parse_html($ie->content));
print "===> content OK\n";

my (%auth_mod, %auth);

while ($content =~ m/\s([A-Z]+\s+[\w\-\.]+)\.tar\.gz/g) {
	my $auth_mod = $1;
	$auth_mod =~ s/-[\d\.a-z]+$//;	# バージョンのダブリンチョ削除
	++$auth_mod{$auth_mod};
}
print scalar(keys %auth_mod), " modules.\n";
open(MOD, ">./CPAN_MOD.txt");
for (sort keys %auth_mod) {
	print MOD "$_\n";
}

map { ++$auth{(split)[0]} } keys %auth_mod;
print scalar(keys %auth), " authors.\n\n";

print "Top 10 heavy authors.\n";
my $ctr = 0;
for (sort { $auth{$b} <=> $auth{$a} } keys %auth) {
	printf "%-12s %3d\n", $_, $auth{$_};
	last if ++$ctr >= 10;
}

sleep 3;
$ie->close;
__END__

Hirosi Taguti
taguti @ tokyo.pm.org




Tokyo-pm メーリングリストの案内