| line | stmt | bran | cond | sub | pod | time | code | 
| 1 |  |  |  |  |  |  | package WWW::Chain::UA::LWP; | 
| 2 |  |  |  |  |  |  | BEGIN { | 
| 3 | 2 |  |  | 2 |  | 3878 | $WWW::Chain::UA::LWP::AUTHORITY = 'cpan:GETTY'; | 
| 4 |  |  |  |  |  |  | } | 
| 5 |  |  |  |  |  |  | { | 
| 6 |  |  |  |  |  |  | $WWW::Chain::UA::LWP::VERSION = '0.003'; | 
| 7 |  |  |  |  |  |  | } | 
| 8 |  |  |  |  |  |  |  | 
| 9 | 2 |  |  | 2 |  | 19 | use Moo; | 
|  | 2 |  |  |  |  | 4 |  | 
|  | 2 |  |  |  |  | 15 |  | 
| 10 |  |  |  |  |  |  | extends 'LWP::UserAgent'; | 
| 11 |  |  |  |  |  |  |  | 
| 12 |  |  |  |  |  |  | with qw( WWW::Chain::UA ); | 
| 13 |  |  |  |  |  |  |  | 
| 14 | 2 |  |  | 2 |  | 826 | use Scalar::Util 'blessed'; | 
|  | 2 |  |  |  |  | 14 |  | 
|  | 2 |  |  |  |  | 439 |  | 
| 15 |  |  |  |  |  |  |  | 
| 16 |  |  |  |  |  |  | sub request_chain { | 
| 17 | 1 |  |  | 1 | 0 | 55 | my ( $self, $chain ) = @_; | 
| 18 | 1 | 50 | 33 |  |  | 24 | die __PACKAGE__."->request_chain needs a WWW::Chain object as parameter" | 
| 19 |  |  |  |  |  |  | unless ( blessed($chain) && $chain->isa('WWW::Chain') ); | 
| 20 | 1 |  |  |  |  | 7 | while (!$chain->done) { | 
| 21 | 2 |  |  |  |  | 4 | my @responses; | 
| 22 | 2 |  |  |  |  | 4 | for (@{$chain->next_requests}) { | 
|  | 2 |  |  |  |  | 11 |  | 
| 23 | 2 |  |  |  |  | 37 | my $response = $self->request($_); | 
| 24 | 2 |  |  |  |  | 154746 | push @responses, $response; | 
| 25 |  |  |  |  |  |  | } | 
| 26 | 2 |  |  |  |  | 19 | $chain->next_responses(@responses); | 
| 27 |  |  |  |  |  |  | } | 
| 28 | 1 |  |  |  |  | 27 | return $chain; | 
| 29 |  |  |  |  |  |  | } | 
| 30 |  |  |  |  |  |  |  | 
| 31 |  |  |  |  |  |  | 1; | 
| 32 |  |  |  |  |  |  | __END__ |