| 1 | package OpenID::Lite::RelyingParty::Discover::Fetcher::Yadis::HTMLExtractor; | ||||||||||||||||||||
| 2 | |||||||||||||||||||||
| 3 | 3 | ▶ | use HTML::TreeBuilder::XPath; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 4 | 3 | ▶ | use URI::Escape (); | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 5 | 3 | ▶ | use OpenID::Lite::Constants::Yadis qw(XRDS_HEADER YADIS_HEADER); | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 6 | |||||||||||||||||||||
| 7 | 1 | ▶ | sub extract { | ||||||||||||||||||
|
Subroutine
extract: called CC=3 SCAR=12.3
Pod
undocumented
| |||||||||||||||||||||
| 8 | 1 | my ( $class, $content ) = @_; | |||||||||||||||||||
| 9 | |||||||||||||||||||||
| 10 | 1 | my $tree = HTML::TreeBuilder::XPath->new; | |||||||||||||||||||
| 11 | 1 | $tree->parse(lc $content); | |||||||||||||||||||
| 12 | 1 | ▶ | my $location | ||||||||||||||||||
|
Condition33%1/3
$tree->findvalue($class->_build_xpath_with('X-XRDS-Location')) || $tree->findvalue($class->_build_xpath_with('X-Yadis-Location'))
MC/DC0%0/2
$tree->findvalue($class->_build_xpath_with('X-XRDS-Location')) || $tree->findvalue($class->_build_xpath_with('X-Yadis-Location'))
$tree->findvalue($class->_build_xpath_with('X-XRDS-Location'))
$tree->findvalue($class->_build_xpath_with('X-Yadis-Location'))
Truth table33%1/3
A || B
A= $tree->findvalue($class->_build_xpath_with('X-XRDS-Location'))B= $tree->findvalue($class->_build_xpath_with('X-Yadis-Location'))
| |||||||||||||||||||||
| 13 | = $tree->findvalue( $class->_build_xpath_with( XRDS_HEADER ) ) | ||||||||||||||||||||
| 14 | || $tree->findvalue( $class->_build_xpath_with( YADIS_HEADER ) ); | ||||||||||||||||||||
| 15 | 1 | ▶ | return unless $location; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 16 | 0 | return URI::Escape::uri_unescape($location); | |||||||||||||||||||
| 17 | } | ||||||||||||||||||||
| 18 | |||||||||||||||||||||
| 19 | 2 | ▶ | sub _build_xpath_with { | ||||||||||||||||||
|
Subroutine
_build_xpath_with: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 20 | 2 | my ( $class, $header ) = @_; | |||||||||||||||||||
| 21 | 2 | return sprintf(q{/html/head/meta[@http-equiv='%s']/@content}, lc $header) | |||||||||||||||||||
| 22 | } | ||||||||||||||||||||
| 23 | |||||||||||||||||||||
| 24 | 3 | 1; | |||||||||||||||||||
| 25 | |||||||||||||||||||||