News::Overview::Entry - an object for storing specific overview information
use News::Overview::Entry; use News::Overview; my $article = new News::Article; # Populate News::Article somehow; # Create a new News::Overview::Entry object my $msgid = $article->header('message-id'); my @refs = split(/\s+/, $article->header('references') || ""); my %other; foreach ( News::Overview->defaults ) { $other{$_} = $article->header($_) || ""; } my $entry = News::Overview::Entry->new($msgid, \@refs, %other);
See below for more specific information about related functions.
News::Overview::Entry is an object meant to hold overview information about a single news article - that is, the minimal information necessary to sort the article with other articles, as used by XOVER in the NNTP specification. It is primarily a helper class for use with News::Overview; see that manual page for more information.
All of this object's usage is contained within its functions.
Creates a new News::Overview::Entry object. MSGID is the Message-ID of the object, and is required (the function will return undef if it's not present).
MSGID
REFERENCES is an arrayref that contains the message-IDs of the entry's parents. OTHER is a hash of other information about the article, which are stored in the entry.
REFERENCES
OTHER
Returns the associated message-ID of the Entry.
Returns the Entry's parent's message-ID, or undef if there isn't one. This is currently defined as "the last item in References". This isn't currently being used, and may change to something else.
Returns all of the children of the current Entry; each returned item is another News::Article::Entry object. Note that no children exist until they are added with add_child().
Returns the value of the information stired in FIELD within the Entry.
FIELD
Returns a hashref containing all of the keys and values of the information associated with the Entry.
These functions offer additional information about the Entry, generally by parsing the above information.
Returns the "depth" of the Entry, ie the number references above the article. A parent article (one with no References) is depth 0.
Returns the time, in seconds since the epoch, that the Entry says it was posted at (generated by parsing the Date header; will default to 0).
This information is cached for later use within the item.
Returns the newsgroups associated with the entry, either by parsing the Newsgroups field or Xref. Returns an array of associated newsgroups.
Besides new(), these functions are the only ones that actually modify the Entry in a notable way.
Add children to the given item, each of which is a News::Overview::Entry object. These are later accessed with children(). This is useful for threading.
Returns the number of children that were successfully added.
News::Overview, Date::Parse
News::Overview
Use the parent() bit effectively. Make "pseudo-Entries", to make entries for articles that don't exist, to make threading more accurate.
Tim Skirvin <tskirvin@killfile.org>
Copyright 2003 by Tim Skirvin <tskirvin@killfile.org>. This code may be distributed under the same terms as Perl itself.
1 POD Error
The following errors were encountered while parsing the POD:
You forgot a '=back' before '=head1'
To install News::Overview, copy and paste the appropriate command in to your terminal.
cpanm
cpanm News::Overview
CPAN shell
perl -MCPAN -e shell install News::Overview
For more information on module installation, please visit the detailed CPAN module installation guide.