line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Catmandu::Fix::memento_find; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
our $VERSION = '0.14'; |
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
185210
|
use Catmandu::Sane; |
|
1
|
|
|
|
|
173134
|
|
|
1
|
|
|
|
|
9
|
|
6
|
1
|
|
|
1
|
|
341
|
use Moo; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
7
|
1
|
|
|
1
|
|
973
|
use Memento::TimeTravel; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
43
|
|
8
|
1
|
|
|
1
|
|
453
|
use Catmandu::Fix::Has; |
|
1
|
|
|
|
|
953
|
|
|
1
|
|
|
|
|
7
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
has path => (fix_arg => 1); |
11
|
|
|
|
|
|
|
has date => (fix_arg => 1); |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
with 'Catmandu::Fix::SimpleGetValue'; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub emit_value { |
16
|
1
|
|
|
1
|
0
|
7419
|
my ($self, $var) = @_; |
17
|
1
|
|
|
|
|
6
|
my $date = $self->date; |
18
|
|
|
|
|
|
|
|
19
|
1
|
|
|
|
|
9
|
"${var} = Memento::TimeTravel::find_mementos(${var},${date}) if is_string(${var}) && length(${var});"; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
=head1 NAME |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
Catmandu::Fix::memento_find - find Mementos for a url |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
=head1 SYNOPSIS |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
# Find mementos for a URL. E.g. myurl => 'http://www.ugent.be' |
29
|
|
|
|
|
|
|
memento_find(myurl,2013) |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=head1 SEE ALSO |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
L<Catmandu::Fix> |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=cut |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
1; |