line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package WWW::Blog::Metadata::MobileLinkDiscovery; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
23452
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
42
|
|
4
|
1
|
|
|
1
|
|
6
|
use vars qw($VERSION); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
68
|
|
5
|
|
|
|
|
|
|
$VERSION = '0.02'; |
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
492
|
use WWW::Blog::Metadata; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
use URI; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
WWW::Blog::Metadata->mk_accessors(qw( mobile_link mobile_link_type )); |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub on_got_tag { |
13
|
|
|
|
|
|
|
my $class = shift; |
14
|
|
|
|
|
|
|
my($meta, $tag, $attr, $base_uri) = @_; |
15
|
|
|
|
|
|
|
if ($tag eq 'link' && $attr->{rel} && lc($attr->{rel}) eq 'alternate' && $attr->{media} =~ /handheld/) { |
16
|
|
|
|
|
|
|
my %media = map { s/[^a-zA-Z0-9\-].*$//; ($_ => 1) } |
17
|
|
|
|
|
|
|
split /,\s*/, $attr->{media}; |
18
|
|
|
|
|
|
|
if ($media{handheld}) { |
19
|
|
|
|
|
|
|
$meta->mobile_link(URI->new_abs($attr->{href}, $base_uri)->as_string); |
20
|
|
|
|
|
|
|
$meta->mobile_link_type($attr->{type}); |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub on_got_tag_order { 99 } |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
1; |
28
|
|
|
|
|
|
|
__END__ |