| 1 | |||||||||||
| 2 | package MyConText::URL; | ||||||||||
| 3 | 1 | ▶ | use MyConText::String; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 1 | ▶ | use vars qw! @ISA !; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 1 | @ISA = qw! MyConText::String !; | |||||||||
| 7 | |||||||||||
| 8 | 1 | ▶ | use LWP::UserAgent; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | |||||||||||
| 10 | 0 | ▶ | sub index_document { | ||||||||
|
Subroutine
index_document: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||
| 11 | 0 | my ($self, $uri) = @_; | |||||||||
| 12 | my $ua = ( defined $self->{'user_agent'} | ||||||||||
| 13 | ? $self->{'user_agent'} | ||||||||||
| 14 | 0 | ▶ | : $self->{'user_agent'} = new LWP::UserAgent ); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 15 | |||||||||||
| 16 | 0 | my $request = new HTTP::Request('GET', $uri); | |||||||||
| 17 | 0 | my $response = $ua->simple_request($request); | |||||||||
| 18 | 0 | ▶ | if ($response->is_success) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 19 | 0 | return $self->SUPER::index_document($uri, $response->content); | |||||||||
| 20 | } | ||||||||||
| 21 | else { | ||||||||||
| 22 | 0 | $self->{'errstr'} = $response->message; | |||||||||
| 23 | } | ||||||||||
| 24 | 0 | return; | |||||||||
| 25 | } | ||||||||||
| 26 | |||||||||||
| 27 | 1 | 1; | |||||||||
| 28 | |||||||||||