From 5dd71a777832ccaddd3d37fb1c8abfa4be004b55 Mon Sep 17 00:00:00 2001 From: franck cuny Date: Thu, 25 Jun 2009 14:49:11 +0200 Subject: POD --- lib/MooseX/UserAgent/Async.pm | 2 +- lib/MooseX/UserAgent/Cache.pm | 2 +- lib/MooseX/UserAgent/Config.pm | 64 ++++++++++++++++++++++++++++++++++++++++- lib/MooseX/UserAgent/Content.pm | 2 +- 4 files changed, 66 insertions(+), 4 deletions(-) (limited to 'lib/MooseX/UserAgent') diff --git a/lib/MooseX/UserAgent/Async.pm b/lib/MooseX/UserAgent/Async.pm index 3c9a09d..186a183 100644 --- a/lib/MooseX/UserAgent/Async.pm +++ b/lib/MooseX/UserAgent/Async.pm @@ -63,7 +63,7 @@ RTGI::Role::UserAgent::Async - Fetch an url using AnyEvent::HTTP =head1 AUTHOR -franck cuny C<< >> +franck cuny C<< >> =head1 LICENCE AND COPYRIGHT diff --git a/lib/MooseX/UserAgent/Cache.pm b/lib/MooseX/UserAgent/Cache.pm index de9b24d..fa235d7 100644 --- a/lib/MooseX/UserAgent/Cache.pm +++ b/lib/MooseX/UserAgent/Cache.pm @@ -56,7 +56,7 @@ RTGI::Role::UserAgent::Cache =head1 AUTHOR -franck cuny C<< >> +franck cuny C<< >> =head1 LICENCE AND COPYRIGHT diff --git a/lib/MooseX/UserAgent/Config.pm b/lib/MooseX/UserAgent/Config.pm index 40b0720..d5d6730 100644 --- a/lib/MooseX/UserAgent/Config.pm +++ b/lib/MooseX/UserAgent/Config.pm @@ -10,6 +10,8 @@ has 'agent' => ( my $self = shift; my $ua = LWP::UserAgent->new; + if (!$self->can('useragent_conf')) { + } my $conf = $self->useragent_conf; $ua->agent( $conf->{name} ) if $conf->{name}; $ua->from( $conf->{mail} ) if $conf->{mail}; @@ -27,13 +29,73 @@ __END__ RTGI::Role::UserAgent::Config +=head1 SYNOPSIS + + has useragent_conf => ( + isa => 'HashRef', + default => sub { + { + name => 'myownbot', + mail => 'mail\@bot.com', + timeout => 60, + max_size => 50000, + cache => { + use_cache => 1, + namespace => 'mybotua', + root => '/tmp', + } + }; + } + ); + =head1 DESCRIPTION +=over 4 + +=item B + +UserAgent string used by the HTTP client. Default is to use the LWP or +AnyEvent::HTTP string. + +=item B + +Mail string used by the HTTP client (only for LWP). Default is to use the +LWP string. + +=item B + +Max size that will be fetched by the useragent, in octets (only for LWP). +Default is set to 3 000 000. + +=item B + +Time out. Default is set to 30. + +=item B + +=over 2 + +=item B + +If you need caching, set to 1. Default is no cache. + +=item B + +Where to store the cache. + +=item B + +=item B + +=back + +=back + =head1 BUGS AND LIMITATIONS =head1 AUTHOR -franck cuny C<< >> +franck cuny C<< >> =head1 LICENCE AND COPYRIGHT diff --git a/lib/MooseX/UserAgent/Content.pm b/lib/MooseX/UserAgent/Content.pm index 024531f..1b3f5ee 100644 --- a/lib/MooseX/UserAgent/Content.pm +++ b/lib/MooseX/UserAgent/Content.pm @@ -37,7 +37,7 @@ RTGI::Role::UserAgent::Content =head1 AUTHOR -franck cuny C<< >> +franck cuny C<< >> =head1 LICENCE AND COPYRIGHT -- cgit 1.4.1