Acme-CPANAuthors-Russian

 view release on metacpan or  search on metacpan

script/cpan-author.pl  view on Meta::CPAN

	EXP  => 24*60*60, # 1 day
};

sub get {
	my $self = shift;
	
	unlink FILE if -e FILE && time - [stat(FILE)]->[9] > EXP;
	
	if (my $data = eval { local $/; open my $fh, '<', FILE or die $!; <$fh> }) {
		warn 'cache';
		$_->request(HTTP::Request->new('GET', shift)), return $_ for HTTP::Response->new(200, 'OK', undef, $data);
	}
	for ($self->SUPER::get(@_)) {
		open my $fh, '>', FILE or die $!;
		print   $fh $_->content;
		
		return $_;
	}
}

1;

script/cpan-faces.pl  view on Meta::CPAN

#!/usr/bin/perl
use strict;

use POE qw(Component::Client::HTTP);
use HTTP::Request::Common 'GET';

use lib '../lib';
use Acme::CPANAuthors;

my $a = Acme::CPANAuthors->new(shift || 'Russian');

POE::Component::Client::HTTP->spawn(Alias => 'HTTP_CLIENT', FollowRedirects => 0);

POE::Session->create(
	inline_states => {



( run in 0.229 second using v1.01-cache-2.11-cpan-4505f990765 )