line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
package MyConText::URL; |
3
|
1
|
|
|
1
|
|
658
|
use MyConText::String; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
21
|
|
4
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
29
|
|
5
|
1
|
|
|
1
|
|
5
|
use vars qw! @ISA !; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
39
|
|
6
|
|
|
|
|
|
|
@ISA = qw! MyConText::String !; |
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
1155548
|
use LWP::UserAgent; |
|
1
|
|
|
|
|
4821369
|
|
|
1
|
|
|
|
|
137
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub index_document { |
11
|
0
|
|
|
0
|
1
|
|
my ($self, $uri) = @_; |
12
|
0
|
0
|
|
|
|
|
my $ua = ( defined $self->{'user_agent'} |
13
|
|
|
|
|
|
|
? $self->{'user_agent'} |
14
|
|
|
|
|
|
|
: $self->{'user_agent'} = new LWP::UserAgent ); |
15
|
|
|
|
|
|
|
|
16
|
0
|
|
|
|
|
|
my $request = new HTTP::Request('GET', $uri); |
17
|
0
|
|
|
|
|
|
my $response = $ua->simple_request($request); |
18
|
0
|
0
|
|
|
|
|
if ($response->is_success) { |
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; |
28
|
|
|
|
|
|
|
|