| 1 | package POE::Component::WWW::GetPageTitle; | ||||||||||
| 2 | |||||||||||
| 3 | 2 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 2 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 2 | our $VERSION = '2.001002'; # VERSION | |||||||||
| 7 | |||||||||||
| 8 | 2 | ▶ | use POE; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | 2 | ▶ | use WWW::GetPageTitle; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | 2 | ▶ | use base 'POE::Component::NonBlockingWrapper::Base'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | |||||||||||
| 12 | 0 | ▶ | sub _methods_define { | ||||||||
|
Subroutine
_methods_define: not called CC=1 SCAR=6.9
| |||||||||||
| 13 | 0 | return ( get_title => '_wheel_entry' ); | |||||||||
| 14 | } | ||||||||||
| 15 | |||||||||||
| 16 | 0 | ▶ | sub get_title { | ||||||||
|
Subroutine
get_title: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 17 | 0 | $poe_kernel->post( shift->{session_id} => get_title => @_ ); | |||||||||
| 18 | } | ||||||||||
| 19 | |||||||||||
| 20 | 0 | ▶ | sub _prepare_wheel { | ||||||||
|
Subroutine
_prepare_wheel: not called CC=2 SCAR=17.9
| |||||||||||
| 21 | 0 | my $self = shift; | |||||||||
| 22 | $self->{obj} = WWW::GetPageTitle->new( | ||||||||||
| 23 | 0 | ▶ | $self->{ua} ? ( ua => $self->{ua} ) : (), | ||||||||
|
Branch: 1 branch
| |||||||||||
| 24 | ); | ||||||||||
| 25 | } | ||||||||||
| 26 | |||||||||||
| 27 | 0 | ▶ | sub _process_request { | ||||||||
|
Subroutine
_process_request: not called CC=2 SCAR=17.9
| |||||||||||
| 28 | 0 | my ( $self, $in_ref ) = @_; | |||||||||
| 29 | 0 | my $t = $self->{obj}; | |||||||||
| 30 | 0 | $t->get_title( $in_ref->{page} ); | |||||||||
| 31 | |||||||||||
| 32 | 0 | ▶ | if ( my $error = $t->error ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 33 | 0 | $in_ref->{error} = $error; | |||||||||
| 34 | } | ||||||||||
| 35 | else { | ||||||||||
| 36 | 0 | $in_ref->{title} = $t->title; | |||||||||
| 37 | } | ||||||||||
| 38 | |||||||||||
| 39 | 0 | return; | |||||||||
| 40 | } | ||||||||||
| 41 | |||||||||||
| 42 | 2 | 1; | |||||||||
| 43 | __END__ | ||||||||||