SYNOPSIS

  my $perlanet = Perlanet->new;
  $perlanet->run;

DESCRIPTION

Perlanet is a program for creating programs that aggregate web feeds (both \s-1RSS\s0 and Atom). Web pages like this are often called \*(L"Planets\*(R" after the Python software which originally popularised them. Perlanet is a planet builder written in Perl - hence \*(L"Perlanet\*(R".

You are probably interested in Perlanet::Simple to get started straight out of the box, batteries included style.

Perlanet itself is the driving force behind everything, however. Perlanet reads a series of web feeds (filtering only those that are valid), sorts and selects entries from these web feeds, and then creates a new aggregate feed and renders this aggregate feed. Perlanet allows the user to customize all of these steps through subclassing and roles.

For most uses, you probably don't want to use the Perlanet module. The perlanet command line program is far more likely to be useful.

CONSTRUCTOR

new

my $perlanet = Perlanet->new

The constructor method. Can be passed a hashref of initialisers.

See \*(L"\s-1ATTRIBUTES\s0\*(R" below for details of the key/value pairs to pass in.

ATTRIBUTES

ua

An instance of LWP::UserAgent. Defaults to a simple agent using \*(C`$cfg->{agent}\*(C' as the user agent name, or \*(C` Perlanet/$VERSION \*(C'.

cutoff

An instance of DateTime which represents the earliest date for which feed posts will be fetched/shown.

feeds

An arrayref of Perlanet::Feed objects representing the feeds to collect data from.

METHODS

fetch_page

Attempt to fetch a web page and a returns a URI::Fetch::Response object.

fetch_feeds

Called internally by \*(L"run\*(R" and passed the list of feeds in \*(L"feeds\*(R".

Attempt to download all given feeds, as specified in the \*(C`feeds\*(C' attribute. Returns a list of Perlanet::Feed objects, with the actual feed data loaded.

\s-1NB:\s0 This method also modifies the contents of \*(L"feeds\*(R".

select_entries

Called internally by \*(L"run\*(R" and passed the list of feeds from \*(L"fetch_feeds\*(R".

Returns a combined list of Perlanet::Entry objects from all given feeds.

sort_entries

Called internally by \*(L"run\*(R" and passed the list of entries from \*(L"select_entries\*(R".

Sort the given list of entries into created/modified order for aggregation, and filters them if necessary.

Takes a list of Perlanet::Entrys, and returns an ordered list.

build_feed

Called internally by \*(L"run\*(R" and passed the list of entries from \*(L"sort_entries\*(R".

Takes a list of Perlanet::Entrys, and returns a Perlanet::Feed that is the actual feed for the planet.

clean_html

Clean a \s-1HTML\s0 string so it is suitable for display.

Takes a \s-1HTML\s0 string and returns a \*(L"cleaned\*(R" \s-1HTML\s0 string.

clean_entries

Clean all entries for the planet.

Takes a list of entries, runs them through \*(C`clean\*(C' and returns a list of cleaned entries.

render

Called internally by \*(L"run\*(R" and passed the feed from \*(L"build_feed\*(R".

This is the hook where you generate some type of page to display the result of aggregating feeds together (ie, inserting the posts into a database, running a \s-1HTML\s0 templating library, etc)

Takes a Perlanet::Feed as input (as generated by build_feed.

run

The main method which runs the perlanet process.

TO DO

See http://wiki.github.com/davorg/perlanet

SUPPORT

There is a mailing list which acts as both a place for developers to talk about maintaining and improving Perlanet and also for users to get support. You can sign up to this list at http://lists.mag-sol.com/mailman/listinfo/perlanet <http://lists.mag-sol.com/mailman/listinfo/perlanet>

To report bugs in Perlanet, please use the \s-1CPAN\s0 request tracker. You can either use the web page at <http://rt.cpan.org/Public/Bug/Report.html?Queue=Perlanet> or send an email to [email protected].

RELATED TO Perlanet…

  • perlanet

  • Plagger

AUTHOR

Dave Cross, <[email protected]>

COPYRIGHT AND LICENSE

Copyright (c) 2010 by Magnum Solutions Ltd.

This 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.