line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package OpenID::Lite::RelyingParty::Discover::Fetcher::Yadis::HTMLExtractor; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
7
|
use HTML::TreeBuilder::XPath; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
14
|
|
4
|
1
|
|
|
1
|
|
28
|
use URI::Escape (); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
22
|
|
5
|
1
|
|
|
1
|
|
6
|
use OpenID::Lite::Constants::Yadis qw(XRDS_HEADER YADIS_HEADER); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
232
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
sub extract { |
8
|
0
|
|
|
0
|
0
|
|
my ( $class, $content ) = @_; |
9
|
|
|
|
|
|
|
|
10
|
0
|
|
|
|
|
|
my $tree = HTML::TreeBuilder::XPath->new; |
11
|
0
|
|
|
|
|
|
$tree->parse(lc $content); |
12
|
0
|
|
0
|
|
|
|
my $location |
13
|
|
|
|
|
|
|
= $tree->findvalue( $class->_build_xpath_with( XRDS_HEADER ) ) |
14
|
|
|
|
|
|
|
|| $tree->findvalue( $class->_build_xpath_with( YADIS_HEADER ) ); |
15
|
0
|
0
|
|
|
|
|
return unless $location; |
16
|
0
|
|
|
|
|
|
return URI::Escape::uri_unescape($location); |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub _build_xpath_with { |
20
|
0
|
|
|
0
|
|
|
my ( $class, $header ) = @_; |
21
|
0
|
|
|
|
|
|
return sprintf(q{/html/head/meta[@http-equiv='%s']/@content}, lc $header) |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
1; |
25
|
|
|
|
|
|
|
|