Skip to content

Instantly share code, notes, and snippets.

@nihen
Created September 18, 2009 14:25
Show Gist options
  • Save nihen/189075 to your computer and use it in GitHub Desktop.
Save nihen/189075 to your computer and use it in GitHub Desktop.
#!/usr/bin/perl
use strict;
use warnings;
use utf8;
use feature qw( say );
use Web::Scraper;
use URI;
use Acme::CPANAuthors::Japanese;
my %authors = (Acme::CPANAuthors::Japanese->authors);
my $scraper = scraper {
process "//ul[1]/li/a", "links[]" => '@href';
};
for ( 1..17 ) {
my $count = 0;
printf('2009-09-%02d: ', $_);
foreach my $link ( @{$scraper->scrape(URI->new(sprintf('http://search.cpan.org/recent?d=200909%02d', $_)))->{links}} ) {
if ( $link =~ m{^http://search\.cpan\.org/~([^/]*)/} ) {
$count++ if $authors{uc($1)};
}
}
say $count;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment