line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package XML::Atom::Syndication::Feed; |
2
|
22
|
|
|
22
|
|
754215
|
use strict; |
|
22
|
|
|
|
|
61
|
|
|
22
|
|
|
|
|
887
|
|
3
|
|
|
|
|
|
|
|
4
|
22
|
|
|
22
|
|
231
|
use base qw( XML::Atom::Syndication::Thing ); |
|
22
|
|
|
|
|
57
|
|
|
22
|
|
|
|
|
30202
|
|
5
|
|
|
|
|
|
|
|
6
|
22
|
|
|
22
|
|
564
|
use XML::Atom::Syndication::Util qw( nodelist ); |
|
22
|
|
|
|
|
48
|
|
|
22
|
|
|
|
|
14016
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
XML::Atom::Syndication::Feed->mk_accessors('element', 'icon', 'logo'); |
9
|
|
|
|
|
|
|
XML::Atom::Syndication::Feed->mk_accessors('XML::Atom::Syndication::Generator', |
10
|
|
|
|
|
|
|
'generator'); |
11
|
|
|
|
|
|
|
XML::Atom::Syndication::Feed->mk_accessors('XML::Atom::Syndication::Text', |
12
|
|
|
|
|
|
|
'subtitle'); |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
# deprecated 0.3 accessors |
15
|
|
|
|
|
|
|
XML::Atom::Syndication::Feed->mk_accessors('attribute', 'version'); |
16
|
|
|
|
|
|
|
XML::Atom::Syndication::Feed->mk_accessors('element', 'copyright', 'modified', |
17
|
|
|
|
|
|
|
'created'); |
18
|
|
|
|
|
|
|
XML::Atom::Syndication::Feed->mk_accessors('XML::Atom::Syndication::Text', |
19
|
|
|
|
|
|
|
'tagline', 'info'); |
20
|
|
|
|
|
|
|
|
21
|
5
|
|
|
5
|
1
|
22
|
sub element_name { 'feed' } |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub add_entry { |
24
|
2
|
|
|
2
|
1
|
9
|
my ($feed, $entry) = @_; |
25
|
2
|
50
|
|
|
|
19
|
$entry = $entry->elem if ref $entry eq 'XML::Atom::Syndication::Entry'; |
26
|
2
|
|
|
|
|
11
|
$feed->set_element($feed->ns, 'entry', $entry, 1); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub insert_entry { |
30
|
2
|
|
|
2
|
1
|
9
|
my ($feed, $entry) = @_; |
31
|
2
|
50
|
|
|
|
16
|
$entry = $entry->elem if ref $entry eq 'XML::Atom::Syndication::Entry'; |
32
|
2
|
|
|
|
|
9
|
my ($first) = nodelist($feed, $feed->ns, 'entry'); |
33
|
2
|
100
|
|
|
|
9
|
if ($first) { |
34
|
1
|
|
|
|
|
4
|
my $e = $feed->elem; |
35
|
1
|
|
|
|
|
4
|
$entry->parent($e); |
36
|
6
|
100
|
|
|
|
26
|
my @new = |
37
|
1
|
|
|
|
|
6
|
map { $_ eq $first ? ($entry, $_) : $_ } @{$e->contents}; |
|
1
|
|
|
|
|
3
|
|
38
|
1
|
|
|
|
|
6
|
$e->contents(\@new); |
39
|
|
|
|
|
|
|
} else { |
40
|
1
|
|
|
|
|
20
|
$feed->set_element($feed->ns, 'entry', $entry, 1); |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub entries { # why? because read_only???? |
45
|
69
|
|
|
69
|
1
|
2699
|
my $feed = shift; |
46
|
69
|
|
|
|
|
460
|
my @nodes = nodelist($feed, $feed->ns, 'entry'); |
47
|
69
|
50
|
|
|
|
254
|
return unless @nodes; |
48
|
69
|
|
|
|
|
123
|
my @entries; |
49
|
69
|
|
|
|
|
11748
|
require XML::Atom::Syndication::Entry; |
50
|
69
|
|
|
|
|
3302
|
foreach my $node (@nodes) { |
51
|
78
|
|
|
|
|
371
|
my $entry = |
52
|
|
|
|
|
|
|
XML::Atom::Syndication::Entry->new(Elem => $node, |
53
|
|
|
|
|
|
|
Namespace => $feed->ns); |
54
|
78
|
|
|
|
|
250
|
push @entries, $entry; |
55
|
|
|
|
|
|
|
} |
56
|
69
|
|
|
|
|
342
|
@entries; |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
1; |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
__END__ |