line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::Google::Code::AtomParser; |
2
|
2
|
|
|
2
|
|
1437
|
use strict; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
93
|
|
3
|
2
|
|
|
2
|
|
11
|
use warnings; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
240
|
|
4
|
|
|
|
|
|
|
|
5
|
2
|
|
|
2
|
|
12
|
use Params::Validate ':all'; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
487
|
|
6
|
2
|
|
|
2
|
|
12
|
use HTML::Entities; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
871
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub new { |
9
|
4
|
|
|
4
|
1
|
11
|
my $class = shift; |
10
|
4
|
|
|
|
|
26
|
bless \(my $a), $class; |
11
|
|
|
|
|
|
|
} |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub parse { |
14
|
4
|
|
|
4
|
1
|
9
|
my $self = shift; |
15
|
4
|
|
|
|
|
39
|
my ($content) = validate_pos( @_, 1 ); |
16
|
|
|
|
|
|
|
|
17
|
4
|
|
|
|
|
12
|
my $feed = {}; |
18
|
4
|
|
|
|
|
12
|
my $entries = []; |
19
|
|
|
|
|
|
|
|
20
|
4
|
50
|
|
|
|
48
|
if ( $content =~ /(.*?)/s ) { |
21
|
4
|
|
|
|
|
19
|
my $feed_info = $1; |
22
|
4
|
|
|
|
|
53
|
while ( $feed_info =~ m{<(?!link)(\w+).*?>(.*)\1>}sg ) { |
23
|
12
|
|
|
|
|
165
|
$feed->{$1} = decode_entities($2); |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
4
|
|
|
|
|
42
|
while ( $content =~ m{(.*?)}sg ) { |
28
|
80
|
|
|
|
|
208
|
my $entry_info = $1; |
29
|
80
|
|
|
|
|
109
|
my $entry = {}; |
30
|
80
|
|
|
|
|
737
|
while ( $entry_info =~ m{<(?!link)(\w+).*?>(.*)\1>}sg ) { |
31
|
400
|
|
|
|
|
860
|
my $value = $2; |
32
|
400
|
|
|
|
|
1026
|
$value =~ s!\s*<(\w+)>(.*?)\1>\s*!$2!g; |
33
|
400
|
|
|
|
|
3964
|
$entry->{$1} = decode_entities($value); |
34
|
|
|
|
|
|
|
} |
35
|
80
|
|
|
|
|
663
|
push @$entries, $entry; |
36
|
|
|
|
|
|
|
} |
37
|
4
|
|
|
|
|
25
|
return ( $feed, $entries ); |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
1; |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
__END__ |