Perlanet(3pm)
β¨ Perlanet π
okay bestie so this is Perlanet β the Perl module that lives on the perl man pages (the 3pm kind, you know the vibe). It's a program for making programs that aggregate web feeds, both RSS and Atom, no cap. π¦
πΈ SYNOPSIS πΈ
my $perlanet = Perlanet->new;
$perlanet->run;
that's it. two lines. iconic behavior honestly. π
π DESCRIPTION π
so like. Perlanet is a program for creating programs that aggregate web feeds (both RSS and Atom, we don't play favorites π«Ά). Web pages that do this whole thing are usually called "Planets" β named after the Python software that originally popularised them, iykyk. And Perlanet is a planet builder written in Perl... hence "Perlanet". the naming? ate. π
ngl you are probably interested in Perlanet::Simple if you just wanna get started straight out of the box, batteries-included style. that's the starter pack bestie. π
But Perlanet itself is the main character behind literally everything. Perlanet reads a series of web feeds (filtering only the ones that are valid, we don't keep the fake ones β¨), sorts and selects entries from those web feeds, and then creates a new aggregate feed and renders it. And Perlanet lets you customize all of these steps through subclassing and roles. every single step. the customization is giving unlimited.
For most uses though? you probably don't want to use the Perlanet module directly. The perlanet command line program is wayyy more likely to be what you actually want. fr fr.
π CONSTRUCTOR π
new
my $perlanet = Perlanet->new
The constructor method, bestie. You can pass it a hashref of initialisers and it'll take them.
Scroll down to "ATTRIBUTES" for the deets on what key/value pairs you can pass in. π
π¦ ATTRIBUTES π¦
configβ a hash reference that holds the complete contents of the configuration file. the whole thing. no crumbs left.uaβ an instance ofLWP::UserAgent. defaults to a simple agent using$config->{agent}as the user agent name, orPerlanet/$VERSION(yes with the spaces, that's literally how it's written, don't come for me π).cutoffβ an instance ofDateTimethat represents the earliest date for which feed posts will be fetched/shown. anything older than this? not invited to the party. πfeedsβ an arrayref ofPerlanet::Feedobjects representing the feeds we're collecting data from. the whole squad.
β METHODS β
fetch_page
Attempt to fetch a web page and return a URI::Fetch::Response object. go little fetcher go π§
fetch_feeds
Called internally by run, and passed the list of feeds in feeds.
It attempts to download all the given feeds, as specified in the feeds attribute. Returns a list of Perlanet::Feed objects, with the actual feed data loaded. π
NB: this method also modifies the contents of feeds. so like, heads up, it's not a read-only situation bestie. it changes things.
select_entries
Called internally by run, and passed the list of feeds from fetch_feeds.
Returns a combined list of Perlanet::Entry objects from all the given feeds. everyone gets pooled together π
sort_entries
Called internally by run, and passed the list of entries from select_entries.
Sorts 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. chronological excellence, periodt. β¨
cutoff_entries
Called internally by run, and passed the list of entries from sort_entries.
Removes any entries that were published earlier than the cut-off date for this feed. sorry babe, you're too old for this planet π«
build_feed
Called internally by run, and passed the list of entries from sort_entries.
Takes a list of Perlanet::Entrys, and returns a Perlanet::Feed that is the actual feed for the planet. the glow-up is complete π
clean_html
Clean a HTML string so it's suitable for display.
Takes a HTML string and returns a "cleaned" HTML string. sparkly clean π§Όβ¨
clean_entries
Clean all entries for the planet.
Takes a list of entries, runs them through clean and returns a list of cleaned entries. every single one gets the treatment. no skipping.
render
Called internally by run, and passed the feed from build_feed.
This is the hook where you generate some type of page to display the result of aggregating feeds together β like inserting the posts into a database, or running a HTML templating library, etc. this is where you make it yours π
Takes a Perlanet::Feed as input (as generated by build_feed).
run
The main method which runs the perlanet process. the whole shebang. the moment. π
π TO DO π
See <http://wiki.github.com/davorg/perlanet/issues>
(yes bestie it's a wiki link, that's literally what it says, go look π)
π«Ά SUPPORT π«Ά
To report bugs in Perlanet, please use the CPAN 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 bug-Perlanet@rt.cpan.org.
two options, pick your fighter. we appreciate you either way π
π SEE ALSO π
perlanetPlagger
π AUTHOR π
Dave Cross, <dave@perlhacks.com>
π 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.
and that's the whole page bestie!! π¦ this one came to you courtesy of the user-contributed perl docs, perl v5.36.0, dated 2023-02-21, filed under Perlanet(3pm) β mwah, go build a planet πβ¨
π¦ where this page comes from
- debian bookworm: libperlanet-perl 2.2.1-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libperlanet-perl 2.2.1-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libperlanet-perl 2.2.1-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu questing: libperlanet-perl 2.2.1-1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms