value defines the number of
entries to take from each of your source feeds. For example, if this is
set to 1 then there will only be one entry from each feed in your output.
If this value is 0 (or missing) then all values from all source feeds are
used.
.IP "entry_sort_order" 4
.IX Item "entry_sort_order"
Entries have two dates, issued (which is the date that the item was first
published) and modified (which is the date that the item was last updated).
This configuration option controls which of these two dates are used to sort
the entries in a feed. It can be one of the two values \f(CW\*(C`issued\*(C'\fR or
\&\f(CW\*(C`modified\*(C'\fR. If this option is omitted, then \f(CW\*(C`modified\*(C'\fR is used.
.IP "cutoff_duration" 4
.IX Item "cutoff_duration"
Sometimes you might want your generated feed to only contain entries from,
say, the last month. You can do that with the \f(CW\*(C`cutoff_duration\*(C'\fR configuration
option. This takes the form of sub-parameters which are in the same format
as you would use when calling the constructor for
DateTime::Duration (which isn't surprising as that's what happens to
them). For example the to exclude entries that are more than a month old,
you would use:
.Sp
.Vb 2
\& cutoff_duration:
\& months: 1
.Ve
.IP "opml" 4
.IX Item "opml"
The system can optionally create an \s-1OPML\s0 file containing details of the
feeds which are being aggregated. This optional option controls whether or not
this file is created. If it exists, it should be the name of the \s-1OPML\s0 file
to be created. If an \s-1OPML\s0 file is being created, then the \f(CW\*(C`feeds\*(C'\fR options
(described below) will all require a \f(CW\*(C`web\*(C'\fR sub-option.
.IP "page" 4
.IX Item "page"
This mandatory option contains the details of the web page to be created.
There are two sub-options \- \f(CW\*(C`file\*(C'\fR gives the name of the file to be created
and \f(CW\*(C`template\*(C'\fR gives the name of a Template Toolkit template which will be
processed in order to create this file. See the section \*(L"Output Template\*(R"
for more details on this template, and the web site for
more information about the Template Toolkit.
.IP "feed" 4
.IX Item "feed"
This mandatory option contains the details of the web feed to be created.
There are two sub-options \- \f(CW\*(C`file\*(C'\fR gives the name of the file to be created
and \f(CW\*(C`format\*(C'\fR gives the format of the output (currently 'Atom' or '\s-1RSS\s0').
.IP "cache_dir" 4
.IX Item "cache_dir"
This if you give a directory name in this option then perlanet will use the
cache facility of URI::Fetch. This means that web feeds will only be downloaded
when they change.
.IP "feeds" 4
.IX Item "feeds"
This mandatory option gives details of the web feeds to be aggregated. Each
item on the list has one mandatory sub-option and two optional sub-options.
The mandatory sub-option is \f(CW\*(C`url\*(C'\fR which gives the \s-1URL\s0 of the feed. The
optional sub-option \f(CW\*(C`title\*(C'\fR gives a title to the feed which can be used
to identify the entries that originate from this feed. The optional \f(CW\*(C`web\*(C'\fR
sub-option gives a web site \s-1URL\s0 associated with the feed (often the address
of the web site that the feed comes from). This can be used to create a list
of the aggregated sites. The \f(CW\*(C`web\*(C'\fR sub-option becomes mandatory if you are
creating an \s-1OPML\s0 file. You can also add a \f(CW\*(C`max_entries\*(C'\fR option which will
override the global \f(CW\*(C`entries_per_feed\*(C'\fR setting. If this setting exists
and is set to zero, then the output feed will contain all of the entries
from this input feed.
.SS "Example Configuration File"
.IX Subsection "Example Configuration File"
.Vb 10
\& title: planet test
\& description: A Test Planet
\& url: http://planet.example.com/
\& author:
\& name: Dave Cross
\& email: dave@dave.org.uk
\& entries: 20
\& opml: opml.xml
\& page:
\& file: index.html
\& template: index.tt
\& feed:
\& file: atom.xml
\& format: Atom
\& cache_dir: /tmp/feeds
\& feeds:
\& \- url: http://blog.dave.org.uk/atom.xml
\& title: Dave\*(Aqs Blog
\& web: http://blog.dave.org.uk/
\& \- url: http://use.perl.org/~davorg/journal/rss
\& title: Dave\*(Aqs use.perl Journal
\& web: http://use.perl.org/~davorg/journal/
\& \- url: http://www.oreillynet.com/pub/feed/31?au=2607
\& title: Dave on O\*(AqReillynet
\& web: http://www.oreillynet.com/pub/au/2607
.Ve
.SS "Output Template"
.IX Subsection "Output Template"
The web page is created from a Template Toolkit template. This template is
passed two variables.
.IP "feed" 4
.IX Item "feed"
This is the XML::Feed object which has been used to create the aggregated
feed. See the XML::Feed documentation for details of the data that is
held in this object.
.IP "cfg" 4
.IX Item "cfg"
This is the contents of the configuration file, converted to a (nested)
Perl hash.
.SS "Example Output Template"
.IX Subsection "Example Output Template"
This is a simple template which uses the \f(CW\*(C`feed\*(C'\fR variable to display details
of the aggregated feeds.
.PP
.Vb 10
\&
\&
\&
\&
\&
\& [% feed.title %]
\&
\&
\& [% feed.title | html %]
\& [% feed.description | html %]
\& [% FOREACH entry IN feed.entries %]
\&
\& [% entry.content.body %]
\& [% IF entry.author OR entry.issued %]
\& Published[% IF entry.author %] by [% entry.author | html; END %]
\& [% IF entry.issued %] on [% entry.issued | html; END %]
\& [% END %]
\& [% END %]
\&
\& [% feed.author | html %] / [% feed.modified | html %]
\&
\&
.Ve
.PP
In the future, the Perlanet wiki at
will contain a cookbook of useful ideas to include in the output template.
.SH "SUPPORT"
.IX Header "SUPPORT"
To report bugs in Perlanet, please use the \s-1CPAN\s0 request tracker. You can
either use the web page at
or send an email
to bug\-Perlanet@rt.cpan.org.
.SH "SEE ALSO"
.IX Header "SEE ALSO"
.IP "\(bu" 4
perlanet
.IP "\(bu" 4
Plagger
.SH "AUTHOR"
.IX Header "AUTHOR"
Dave Cross,
.SH "COPYRIGHT AND LICENSE"
.IX Header "COPYRIGHT AND LICENSE"
Copyright (C) 2008 by Magnum Solutions Ltd.
.PP
This program library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself, either Perl version 5.10.0 or,
at your option, any later version of Perl 5 you may have available.