Acme-CPANAuthors-Acme-CPANAuthors-Authors

 view release on metacpan or  search on metacpan

lib/Acme/CPANAuthors/Acme/CPANAuthors/Authors.pm  view on Meta::CPAN

    require HTTP::Tiny;
    my $data    = '';
    my $authsec = 0;
    my %authors;
    die "Failed\n"
        unless HTTP::Tiny->new->request(
        'GET',
        'http://www.cpan.org/modules/02packages.details.txt',
        {data_callback => sub {    # Don't scrape the whole file
             my $chunk = shift;
             if ($chunk =~ m[^Acme::CPANAuthors]sm) {
                 $authsec++;
                 $data .= $chunk;
             }
             elsif ($authsec) {    # No more Authors in 02packages
                 while ($data
                     =~ m[^(?:Acme::CPANAuthors(?:::(\S+))?).+\w/\w\w/(\w+)/.+$]mg
                     )
                 {   $authors{$2} //= [];
                     push @{$authors{$2}}, $1;
                 }
                 my %old = authors();    # Current authors
                 my @new = grep { defined $old{$_} ? () : $_ } keys %authors;
                 print scalar(@new)
                     . " new Acme::CPANAuthors authors to add\n";
                 return if !@new;
                 require MetaCPAN::API;
                 my $mcpan = MetaCPAN::API->new();
                 binmode(STDOUT, ':utf8');

                 for my $id (sort @new) {
                     my $author = $mcpan->author($id);
                     printf "    %s => q[%s], # %s\n", $id, $author->{name},
                         join ', ', map { 'A::C::' . $_ } @{$authors{$id}};
                 }
                 exit    # We're done
             }
             }
        }
        )->{success};
}
1;

=head1 Synopsis

    use Acme::CPANAuthors;

    my $authors = Acme::CPANAuthors->new('Acme::CPANAuthors::Acme::CPANAuthors::Authors');

    $number   = $authors->count;
    @ids      = $authors->id;
    @distros  = $authors->distributions('ACALPINI');
    $url      = $authors->avatar_url('SHLOMIF');
    $kwalitee = $authors->kwalitee('SANKO');

=head1 Description

This class provides a hash of Pause IDs/names of Acme::CPANAuthors::*
authorin' CPAN authors.

I started this module because
L<Acme::CPANAuthors::UnitedStates|Acme::CPANAuthors::UnitedStates> doesn't
exist and apparently I'm not listed in
L<Acme::CPANAuthors::Japanese|Acme::CPANAuthors::Japanese>. ((sigh)) I just
want to be a part of something... great... greater... than-- um, sorry, lost
my train of thought.

Anyway, I decided both L<Acme::CPANAuthors::Earth|Acme::CPANAuthors::Earth>
(well covered between http://search.cpan.org/author/ and
http://pause.perl.org/pause/query?ACTION=who_is) and
L<Acme::CPANAuthors::Authors|Acme::CPANAuthors::Authors> (only include authors
who have published at least one distribution, script, etc.) would just be too
time consuming for a 3AM lapse in judgement so... there you are.

=head1 Installation

To install this module, run the following commands:

	perl Build.PL
	./Build
	./Build test
	./Build install

=head1 Maintenance

Have you authored a module in the C<Acme::CPANAuthors> namespace, aren't
listed here, and would like to be? Or are you currently listed but have since
turned away from your deviant, C<Acme> ways and would like to be removed? Just
contact me L<via email|/"AUTHOR"> or stop by the Issue Tracker and I'll fix ya
right up.

=head1 Bugs

Report any bugs or feature requests to the Issue tracker or
directly to L<me via email|/"AUTHOR">. I'll keep you up to date on any related
changes.

Seriously, it's just a list of names... what could possibly go wrong?

E<lt>_E<lt>

E<gt>_E<gt>

Yeah.

=head1 Support

You can find documentation for this module with the perldoc command.

    perldoc Acme::CPANAuthors::Acme::CPANAuthors::Authors

You can also look for information at:

=over 4

=item * Issue Tracker: Acme::CPANAuthors::Acme::CPANAuthors::Authors' bug tracker

http://github.com/sanko/acme-cpanauthors-acme-cpanauthors-authors/issues/

=item * AnnoCPAN: Annotated CPAN documentation



( run in 2.017 seconds using v1.01-cache-2.11-cpan-b301d465b3d )