|
HTML::SummaryBasic - basic summary info from meta tags and the first para. |
HTML::SummaryBasic - basic summary info from meta tags and the first para.
use HTML::SummaryBasic;
my $p = new HTML::SummaryBasic {
PATH => "D:/www/leegoddard_com/essays/aiCreativity.html",
NOT_AVAILABLE =>"There ain't none",
};
# What did we get?
foreach (keys %{$p->{SUMMARY}}){
warn "$_ ... $p->{SUMMARY}->{$_}\n";
}
use HTML::TokeParser;
use HTML::HeadParser;
Creates a hash of useful summary information from meta and body elements.
Accepts a hash-like structure...
get_summary is called (see METHOD get_summary and
THE SUMMARY STRUCTURE).
meta tag names whose content value should be
placed into the respective slots of the SUMMARY field after
get_summary has been called.
A field of the object which is a hash, with key/values as follows:
meta tag of same names.
meta tag of the same name.
meta tag of the same name,
and according to the file system. If the former does not exist,
it takes the value of the latter.
p element of the document.
h1 tag; failing that, the first h2; failing that,
the value of $NOT_AVAILABLE.
FIELDS field.
Optionally takes an argument that over-rides and re-sets the PATH field.
Otherwise uses the PATH field to get a summary and put it into the hash
that is the SUMMARY field. See also THE SUMMARY STRUCTURE.
Return 1 on success, undef on failure, setting $! with an error message.
Optionally takes an argument that over-rides and re-sets the PATH field.
Otherwise uses the PATH field to load an HTML file and return a reference
to a scalar full of it.
Return a reference to a scalar of HTML, or undef on failure, setting $! with an error message.
Maybe work on URI as well as file paths.
the HTML::TokeParser manpage, the HTML::HeadParser manpage.
Lee Goddard (LGoddard@CPAN.org)
Copyright 2000-2001 Lee Goddard.
This library is free software; you may use and redistribute it or modify it undef the same terms as Perl itself.
|
HTML::SummaryBasic - basic summary info from meta tags and the first para. |