line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
our $VERSION = '0.15'; |
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
use Catmandu::Sane; |
5
|
1
|
|
|
1
|
|
451994
|
use Moo; |
|
1
|
|
|
|
|
8
|
|
|
1
|
|
|
|
|
9
|
|
6
|
1
|
|
|
1
|
|
232
|
use Data::Validate::URI; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
6
|
|
7
|
1
|
|
|
1
|
|
809
|
use Memento::TimeTravel; |
|
1
|
|
|
|
|
41357
|
|
|
1
|
|
|
|
|
61
|
|
8
|
1
|
|
|
1
|
|
551
|
use Catmandu::Fix::Has; |
|
1
|
|
|
|
|
7
|
|
|
1
|
|
|
|
|
37
|
|
9
|
1
|
|
|
1
|
|
7
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
9
|
|
10
|
|
|
|
|
|
|
has path => (fix_arg => 1); |
11
|
|
|
|
|
|
|
has date => (fix_arg => 1); |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
with 'Catmandu::Fix::Condition::SimpleAllTest'; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
my ($self, $var) = @_; |
16
|
|
|
|
|
|
|
my $date = $self->date; |
17
|
5
|
|
|
5
|
0
|
25693
|
$date = [localtime]->[5] + 1900 unless defined($date) && length($date); |
18
|
5
|
|
|
|
|
18
|
|
19
|
5
|
50
|
33
|
|
|
33
|
"(is_value(${var}) && Data::Validate::URI::is_web_uri(${var}) && Memento::TimeTravel::find_mementos(${var},${date}))"; |
20
|
|
|
|
|
|
|
} |
21
|
5
|
|
|
|
|
31
|
|
22
|
|
|
|
|
|
|
=head1 NAME |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
Catmandu::Fix::Condition::is_archived_web_uri - check of a field contains an HTTP or HTTPS URI which is archived in a web archive |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
=head1 SYNOPSIS |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
# Check if an archived version is available for any year... |
29
|
|
|
|
|
|
|
if is_archived_web_uri(uri_field,'') |
30
|
|
|
|
|
|
|
... |
31
|
|
|
|
|
|
|
else |
32
|
|
|
|
|
|
|
... |
33
|
|
|
|
|
|
|
end |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
# Check if an archived version is available for a year... |
36
|
|
|
|
|
|
|
if is_archived_web_uri(uri_field,2013) |
37
|
|
|
|
|
|
|
... |
38
|
|
|
|
|
|
|
else |
39
|
|
|
|
|
|
|
... |
40
|
|
|
|
|
|
|
end |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=head1 SEE ALSO |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
L<Catmandu::Fix> |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=cut |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
1; |