The xfn microformat
use Data::Dumper; use HTML::Microformats::DocumentContext; use HTML::Microformats::Format::XFN; my $context = HTML::Microformats::DocumentContext->new($dom, $uri); my @links = HTML::Microformats::Format::XFN->extract_all( $dom->documentElement, $context); foreach my $link (@links) { printf("<%s> %s\n", $link->get_href, join(" ", $link->get_rel)); }
HTML::Microformats::Format::XFN inherits from HTML::Microformats::Format. See the base class definition for a description of property getter/setter methods, constructors, etc.
Returns the hCard for the subject of the relationship. e.g. if Mary has parent Sue, then Mary is the subject. If the subject could not be determined, may return undef. Returns the hCard for the object of the relationship. e.g. if Mary has parent Sue, then Sue is the object. The person that is the object of the relationship may not have an hCard on this page, or the parser may not be able to determine the correct hCard, in which case, may return undef.
HTML::Microformats::Format::XFN supports \s-1XHTML\s0 Friends Network 1.0 and 1.1 as described at <http://gmpg.org/xfn/1> and <http://gmpg.org/xfn/11>; plus the relationship profile described at <http://purl.org/vocab/relationship/>; and \s-1XHTML\s0 Enemies Network 1.0 as described at <http://xen.adactio.com/>.
By default, only \s-1XFN\s0 1.1 is parsed, but if the context has profiles matching the other URIs above, then the other vocabularies are supported.
Data is returned using the \s-1DERI\s0's \s-1XFN\s0 vocabulary (<http://vocab.sindice.com/xfn#>) and when appropriate, Ian Davis' \s-1RDF\s0 relationship vocab (<http://purl.org/vocab/relationship/>) and Toby Inkster's \s-1XEN\s0 vocab (<http://buzzword.org.uk/rdf/xen#>).
Please report any bugs to <http://rt.cpan.org/>.
HTML::Microformats::Format, HTML::Microformats, HTML::Microformats::Format::hCard.
Toby Inkster <[email protected]>.
Copyright 2008-2012 Toby Inkster
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
\s-1THIS\s0 \s-1PACKAGE\s0 \s-1IS\s0 \s-1PROVIDED\s0 \*(L"\s-1AS\s0 \s-1IS\s0\*(R" \s-1AND\s0 \s-1WITHOUT\s0 \s-1ANY\s0 \s-1EXPRESS\s0 \s-1OR\s0 \s-1IMPLIED\s0 \s-1WARRANTIES\s0, \s-1INCLUDING\s0, \s-1WITHOUT\s0 \s-1LIMITATION\s0, \s-1THE\s0 \s-1IMPLIED\s0 \s-1WARRANTIES\s0 \s-1OF\s0 \s-1MERCHANTIBILITY\s0 \s-1AND\s0 \s-1FITNESS\s0 \s-1FOR\s0 A \s-1PARTICULAR\s0 \s-1PURPOSE\s0.