line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
our $VERSION = '0.15'; |
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
use Catmandu::Sane; |
5
|
1
|
|
|
1
|
|
96146
|
use LWP::UserAgent; |
|
1
|
|
|
|
|
158312
|
|
|
1
|
|
|
|
|
7
|
|
6
|
1
|
|
|
1
|
|
861
|
use Moo; |
|
1
|
|
|
|
|
38461
|
|
|
1
|
|
|
|
|
31
|
|
7
|
1
|
|
|
1
|
|
8
|
use Catmandu::Fix::Has; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
14
|
|
8
|
1
|
|
|
1
|
|
717
|
|
|
1
|
|
|
|
|
825
|
|
|
1
|
|
|
|
|
8
|
|
9
|
|
|
|
|
|
|
with 'Catmandu::Fix::Base'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
has path => (fix_arg => 1); |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
my ($self, $fixer) = @_; |
14
|
|
|
|
|
|
|
my $path = $fixer->split_path($self->path); |
15
|
1
|
|
|
1
|
0
|
4459
|
|
16
|
1
|
|
|
|
|
9
|
$fixer->emit_create_path( |
17
|
|
|
|
|
|
|
$fixer->var, |
18
|
|
|
|
|
|
|
$path, |
19
|
|
|
|
|
|
|
sub { |
20
|
|
|
|
|
|
|
my $var = shift; |
21
|
|
|
|
|
|
|
"${var} = LWP::UserAgent->new->get(${var})->code if is_value(${var}) && length(${var});"; |
22
|
1
|
|
|
1
|
|
77
|
} |
23
|
1
|
|
|
|
|
5
|
); |
24
|
|
|
|
|
|
|
} |
25
|
1
|
|
|
|
|
60
|
|
26
|
|
|
|
|
|
|
=head1 NAME |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
Catmandu::Fix::uri_status_code - check the HTTP status of a uri |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=head1 SYNOPSIS |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
copy_field(url,status) |
33
|
|
|
|
|
|
|
uri_status_code(status) # status => '200' |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=head1 SEE ALSO |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
L<Catmandu::Fix> |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=cut |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
1; |