HTML::DublinCore - Extract Dublin Core metadata from HTML
use HTML::DublinCore; ## pass HTML to constructor my $dc = HTML::DublinCore->new( $html ); ## get the title element and print it's content my $title = $dc->element( 'Title' ); print "title: ", $title->content(), "\n"; ## get the same title content in one step print "title: ", $dc->element( 'Title' )->content(), "\n"; ## list context will retrieve all of a particular element foreach my $element ( $dc->element( 'Creator' ) ) { print "creator: ",$element->content(),"\n"; } ## qualified dublin core my $creation = $dc->element( 'Date.created' )->content();
HTML::DublinCore is a module for easily extracting Dublin Core metadata that is embedded in HTML documents. The Dublin Core is a small set of metadata elements for describing information resources. Dublin Core is typically stored in the <HEAD> of and HTML document using the <META> tag. For more information on embedding DublinCore in HTML see RFC 2731 http://www.ietf.org/rfc/rfc2731. For a definition of the meaning of various Dublin Core elements please see http://www.dublincore.org/documents/dces/.
HTML::DublinCore actually extends Brian Cassidy's excellent DublinCore::Record framework by adding some asHTML() methods, and a new constructor.
Constructor which you pass HTML content.
$dc = HTML::DublinCore->new( $html );
Serialize your Dublin Core metadata as HTML <META> tags.
print $dc->asHtml();
More comprehensive tests.
Handle HTML entities properly.
Collect error messages so they can be reported out of the object.
DublinCore::Record
Dublin Core http://www.dublincore.org/
RFC 2731 http://www.ietf.org/rfc/rfc2731
HTML::Parser
perl4lib http://perl4lib.perl.org/
Ed Summers <ehs@pobox.com>
Brian Cassidy <bricas@cpan.org>
Copyright 2004 by Ed Summers, Brian Cassidy
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install HTML::DublinCore, copy and paste the appropriate command in to your terminal.
cpanm
cpanm HTML::DublinCore
CPAN shell
perl -MCPAN -e shell install HTML::DublinCore
For more information on module installation, please visit the detailed CPAN module installation guide.