Skip to content

Commit

Permalink
Import of RCAPUTO/POE-Component-Client-UserAgent-0.07 from CPAN.
Browse files Browse the repository at this point in the history
gitpan-cpan-distribution: POE-Component-Client-UserAgent
gitpan-cpan-version:      0.07
gitpan-cpan-path:         RCAPUTO/POE-Component-Client-UserAgent-0.07.tar.gz
gitpan-cpan-author:       RCAPUTO
gitpan-cpan-maturity:     released
  • Loading branch information
rcaputo authored and Gitpan committed Oct 22, 2014
1 parent 81353c7 commit 759dd7d
Show file tree
Hide file tree
Showing 10 changed files with 135 additions and 36 deletions.
40 changes: 40 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
=================================
2010-01-01T21:59:30.717013Z v0_07
=================================

2010-01-01 21:59:03 (r16) by rcaputo; README M; UserAgent.pm M

Prepare for a new release.

2010-01-01 21:40:14 (r15) by rcaputo; UserAgent.pm M

[rt.cpan.org 24478] Applied Phonohawk's patch to handle more redirect
types.

2010-01-01 21:36:00 (r14) by rcaputo
t/02multi.t M; t/03chunks.t M; t/01basic.t M; UserAgent.pm M

[rt.cpan.org 31287] Fix http_proxy environment variable support,
contributed by Georg Moritz. Untested! LWP::Parallel will not
install. My LWP is too new for it.

2009-07-27 04:58:17 (r13) by rcaputo; Makefile.PL M; UserAgent.pm M

Added a machine-readable repository directory to the distribution.
Documented the bug tracker, repository, and other resource URLs.

2005-06-21 18:36:42 (r12) by rcaputo
CHANGES.OLD A; MANIFEST M; Makefile.PL M; Changes D

Moved the hand-written Changes to CHANGES.OLD, making room for the
automated CHANGES at "make dist" time. Speaking of distributions, I
removed META.yml from the MANIFEST since MakeMaker makes one. I also
added svn-log.perl to Makefile.PL to auto-generate CHANGES.

2005-05-05 05:36:16 (r11) by rcaputo; MANIFEST M

Add META.yml to the MANIFEST.

==============
End of Excerpt
==============
File renamed without changes.
6 changes: 4 additions & 2 deletions MANIFEST
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
Changes
Makefile.PL
# $Id: MANIFEST 12 2005-06-21 18:36:42Z rcaputo $
CHANGES
CHANGES.OLD
MANIFEST
Makefile.PL
README
UserAgent.pm
t/01basic.t
Expand Down
36 changes: 25 additions & 11 deletions META.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,26 @@
# http://module-build.sourceforge.net/META-spec.html
#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX#
name: POE-Component-Client-UserAgent
version: 0.06
version_from: UserAgent.pm
installdirs: site
--- #YAML:1.0
name: POE-Component-Client-UserAgent
version: 0.07
abstract: LWP and LWP::Parallel based POE component.
author:
- Rocco Caputo <rcaputo@cpan.org>
license: unknown
distribution_type: module
configure_requires:
ExtUtils::MakeMaker: 0
build_requires:
ExtUtils::MakeMaker: 0
requires:
LWP::Parallel: 2.51
POE: 0.1402

distribution_type: module
generated_by: ExtUtils::MakeMaker version 6.17
LWP::Parallel: 2.51
POE: 0.31
resources:
license: http://dev.perl.org/licenses/
repository: http://thirdlobe.com/svn/poco-client-ua/trunk
no_index:
directory:
- t
- inc
generated_by: ExtUtils::MakeMaker version 6.54
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
version: 1.4
34 changes: 26 additions & 8 deletions Makefile.PL
Original file line number Diff line number Diff line change
@@ -1,13 +1,31 @@
use ExtUtils::MakeMaker;

open(CHANGES, ">>CHANGES") and close CHANGES;

WriteMakefile (
NAME => 'POE::Component::Client::UserAgent',
VERSION_FROM => 'UserAgent.pm',
AUTHOR => 'Rocco Caputo <troc+pcua@pobox.com>',
ABSTRACT => 'LWP and LWP::Parallel based POE component.',
PM => { 'UserAgent.pm' => '$(INST_LIBDIR)/UserAgent.pm' },
NAME => 'POE::Component::Client::UserAgent',
VERSION_FROM => 'UserAgent.pm',
AUTHOR => 'Rocco Caputo <rcaputo@cpan.org>',
ABSTRACT => 'LWP and LWP::Parallel based POE component.',
PM => {
'UserAgent.pm' => '$(INST_LIBDIR)/UserAgent.pm'
},
PREREQ_PM => {
POE => 0.1402,
LWP::Parallel => 2.51
}
POE => 0.31,
'LWP::Parallel' => 2.51
},
META_ADD => {
resources => {
license => 'http://dev.perl.org/licenses/',
repository => 'http://thirdlobe.com/svn/poco-client-ua/trunk'
},
},
dist => {
COMPRESS => 'gzip -9f',
SUFFIX => 'gz',
PREOP => (
'svn-log.perl --repo https://thirdlobe.com/svn/poco-client-ua | ' .
'tee ./$(DISTNAME)-$(VERSION)/CHANGES > ./CHANGES'
),
},
);
5 changes: 4 additions & 1 deletion README
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ POE::Component::Client::UserAgent
---------------------------------

POE::Component::Client::UserAgent is
Copyright 2001-2002 Rocco Caputo <troc+pcua@pobox.com>
Copyright 2001-2010 Rocco Caputo <troc+pcua@pobox.com>

This library is free software; you can redistribute it
and/or modify it under the same terms as Perl itself.
Expand Down Expand Up @@ -72,6 +72,9 @@ Test scripts are also good examples of the component usage.
See Also
--------

We recommend POE::Component::Client::HTTP as an alternative to this
module.

POE
http://poe.perl.org/

Expand Down
44 changes: 33 additions & 11 deletions UserAgent.pm
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use POE;
use LWP::Parallel;

@POE::Component::Client::UserAgent::ISA = 'LWP::Parallel::UserAgent';
$POE::Component::Client::UserAgent::VERSION = '0.06';
$POE::Component::Client::UserAgent::VERSION = '0.07';

my $debuglevel = 0;

Expand Down Expand Up @@ -56,7 +56,7 @@ sub _pococ_ua_start
$$heap{alias} = $alias;
$object -> $_ ($$args{$_}) for grep exists ($$args{$_}),
qw(agent from timeout redirect duplicates in_order remember_failures
proxy cookie_jar parse_head max_size max_hosts max_req delay);
env_proxy proxy cookie_jar parse_head max_size max_hosts max_req delay);
$kernel->sig(INT => 'sigint');
$kernel->sig(BREAK => 'sigint');
}
Expand Down Expand Up @@ -315,8 +315,11 @@ sub _pococ_ua_postback
# See LWP::Parallel::UserAgent::handle_response for details.
my $code = $response -> code;
if ( $code == HTTP::Status::RC_MOVED_PERMANENTLY
or $code == HTTP::Status::RC_MOVED_TEMPORARILY )
{
or $code == HTTP::Status::RC_MOVED_TEMPORARILY
or $code == HTTP::Status::RC_FOUND
or $code == HTTP::Status::RC_SEE_OTHER
or $code == HTTP::Status::RC_TEMPORARY_REDIRECT
) {
$code = $response -> header ('Client-Warning');
return unless defined ($code) and $code eq 'Redirect loop detected';
}
Expand Down Expand Up @@ -409,6 +412,13 @@ user agent
=head1 DESCRIPTION
B<Note:> C<POE::Component::Client::UserAgent> dependencies frequently
have problems installing. This module is difficult to maintain when
the latest dependencies don't work. As a result, we prefer to
maintain and recommend L<POE::Component::Client::HTTP>. That client
has fewer, more actively maintained dependencies, and it tends to work
better.
C<POE::Component::Client::UserAgent> is based on C<LWP> and C<LWP::Parallel>.
It lets other tasks run while making a request to an Internet server
and waiting for response, and it lets several requests run in parallel.
Expand Down Expand Up @@ -656,15 +666,15 @@ The POE output will also go to the log file you specify.
=item POE
http://poe.perl.org/
L<POE> or http://poe.perl.org/
=item LWP
http://www.linpro.no/lwp/
L<LWP> or http://www.linpro.no/lwp/
=item LWP::Parallel
http://www.inf.ethz.ch/~langhein/ParallelUA/
L<LWP::Parallel> or http://www.inf.ethz.ch/~langhein/ParallelUA/
=back
Expand All @@ -687,14 +697,26 @@ friendly.
The RobotUA variety of UserAgent is not yet implemented.
=head1 AVAILABILITY
L<LWP::Parallel> often cannot install due to feature mismatches with
recent versions of LWP. This interferes with our ability to maintain
and test this module. Please see L<POE::Component::Client::HTTP>,
which does not rely on LWP::Parallel.
=head1 BUG TRACKER
https://rt.cpan.org/Dist/Display.html?Status=Active&Queue=POE-Component-Client-UserAgent
=head1 REPOSITORY
http://thirdlobe.com/svn/poco-client-ua/
=head1 OTHER RESOURCES
The C<PoCoCl::UserAgent> distribution is available on CPAN:
http://search.cpan.org/search?dist=POE-Component-Client-UserAgent
http://search.cpan.org/dist/POE-Component-Client-UserAgent/
=head1 AUTHOR AND COPYRIGHT
Copyright 2001-2002 Rocco Caputo <troc+pcua@pobox.com>
Copyright 2001-2010 Rocco Caputo.
This library is free software; you can redistribute it
and/or modify it under the same terms as Perl itself.
Expand Down
2 changes: 1 addition & 1 deletion t/01basic.t
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ sub _start
{
warn "%%% Start event arrived.\n" if $debuglevel >= 3;
warn "%%% Starting POE::Component::Client::UserAgent...\n" if $debuglevel >= 3;
POE::Component::Client::UserAgent -> new;
POE::Component::Client::UserAgent -> new(env_proxy => 1);
warn "%%% Sending a test request...\n" if $debuglevel >= 3;
$_[KERNEL] -> post (useragent => request =>
request => HTTP::Request -> new (GET => $url),
Expand Down
2 changes: 1 addition & 1 deletion t/02multi.t
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ sub _start
{
warn "%%% Start event arrived.\n" if $debuglevel >= 3;
warn "%%% Starting POE::Component::Client::UserAgent...\n" if $debuglevel >= 3;
POE::Component::Client::UserAgent -> new;
POE::Component::Client::UserAgent -> new(env_proxy => 1);
warn "%%% Sending test requests...\n" if $debuglevel >= 3;
my $postback = $_[SESSION] -> postback ('response');
$_[KERNEL] -> post (useragent => request =>
Expand Down
2 changes: 1 addition & 1 deletion t/03chunks.t
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ sub _start
{
warn "%%% Start event arrived.\n" if $debuglevel >= 3;
warn "%%% Starting POE::Component::Client::UserAgent...\n" if $debuglevel >= 3;
POE::Component::Client::UserAgent -> new;
POE::Component::Client::UserAgent -> new(env_proxy => 1);
warn "%%% Sending a test request...\n" if $debuglevel >= 3;
$_[KERNEL] -> post (useragent => request =>
request => HTTP::Request -> new (GET => $url),
Expand Down

0 comments on commit 759dd7d

Please sign in to comment.