line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Feed::Data::Parser::RSS; |
2
|
|
|
|
|
|
|
|
3
|
6
|
|
|
6
|
|
3974
|
use Moo; |
|
6
|
|
|
|
|
16
|
|
|
6
|
|
|
|
|
45
|
|
4
|
|
|
|
|
|
|
extends 'Feed::Data::Parser::Base'; |
5
|
6
|
|
|
6
|
|
2860
|
use XML::RSS::LibXML; |
|
6
|
|
|
|
|
196
|
|
|
6
|
|
|
|
|
109
|
|
6
|
6
|
|
|
6
|
|
3248
|
use Ref::Util ':all'; |
|
6
|
|
|
|
|
3637
|
|
|
6
|
|
|
|
|
1493
|
|
7
|
6
|
|
|
6
|
|
52
|
use Compiled::Params::OO qw/cpo/; |
|
6
|
|
|
|
|
12
|
|
|
6
|
|
|
|
|
105
|
|
8
|
6
|
|
|
6
|
|
678
|
use Types::Standard qw/Object HashRef Str/; |
|
6
|
|
|
|
|
14
|
|
|
6
|
|
|
|
|
276
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our $validate; |
11
|
|
|
|
|
|
|
BEGIN { |
12
|
6
|
|
|
6
|
|
6179
|
$validate = cpo( |
13
|
|
|
|
|
|
|
get_value => [Object, HashRef, Str], |
14
|
|
|
|
|
|
|
); |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
has '+parser' => ( |
18
|
|
|
|
|
|
|
default => sub { |
19
|
|
|
|
|
|
|
my $self = shift; |
20
|
|
|
|
|
|
|
return XML::RSS::LibXML->new->parse($self->content_ref); |
21
|
|
|
|
|
|
|
}, |
22
|
|
|
|
|
|
|
); |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub get_value { |
25
|
132
|
|
|
132
|
0
|
324
|
my ($self, $item, $action) = $validate->get_value->(@_); |
26
|
|
|
|
|
|
|
|
27
|
132
|
|
|
|
|
1324
|
my $value = $item->{$action}; |
28
|
|
|
|
|
|
|
|
29
|
132
|
50
|
33
|
|
|
315
|
if ( is_scalarref(\$value) || is_arrayref($value) ){ |
|
|
0
|
|
|
|
|
|
30
|
132
|
|
|
|
|
431
|
return $value; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
elsif ( is_hashref($value) ){ |
33
|
0
|
|
|
|
|
|
return $value->{encoded}; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
0
|
|
|
|
|
|
return ''; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
1; # End of Feed::Data |