POE::C...regator(3pm)

πŸ“¦
version 1.11 Β· 2 versions
  • 1.11 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 1.11 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– NAME πŸ’–

POE::Component::RSSAggregator β€” bestie, it watches multiple RSS feeds for new headlines so you don't have to refresh anything like a peasant. ✨

(And yes, the real manual page says "Muliple". We're keeping that typo, it's iconic, it's part of the lore. πŸŽ€)


🌸 VERSION 🌸

Version 1.11 β€” she's vintage, she's stable, she's serving. πŸ’…


✨ SYNOPSIS ✨

Okay so here's the whole vibe. Copy this, it works:

#!/usr/bin/perl
use strict;
use warnings;
use POE;
use POE::Component::RSSAggregator;

my @feeds = (
    {   url   => "http://www.jbisbee.com/rdf/",
        name  => "jbisbee",
        delay => 10,
    },
    {   url   => "http://lwn.net/headlines/rss",
        name  => "lwn",
        delay => 300,
    },
);

POE::Session->create(
    inline_states => {
        _start      => \&init_session,
        handle_feed => \&handle_feed,
    },
);

$poe_kernel->run();

sub init_session {
    my ( $kernel, $heap, $session ) = @_[ KERNEL, HEAP, SESSION ];
    $heap->{rssagg} = POE::Component::RSSAggregator->new(
        alias    => 'rssagg',
        debug    => 1,
        callback => $session->postback("handle_feed"),
        tmpdir   => '/tmp',        # optional caching
    );
    $kernel->post( 'rssagg', 'add_feed', $_ ) for @feeds;
}

sub handle_feed {
    my ( $kernel, $feed ) = ( $_[KERNEL], $_[ARG1]->[0] );
    for my $headline ( $feed->late_breaking_news ) {

        # do stuff with the XML::RSS::Headline object
        print $headline->headline . "\n";
    }
}

Like. That's it. That's the whole girlboss pipeline. πŸ¦‹


πŸŽ€ CONSTRUCTORS πŸŽ€

πŸ’« POE::Component::RSSAggregator->new( %hash );

Spins up a brand new instance of PoCo::RSSAggregator, fresh out the box, no cap. 🫢

Here's what you can hand her:

  • alias β€” the POE alias you want your PoCo::RSSAggregator instance to live under. That's her name, that's her whole identity.
  • debug β€” a boolean that turns on verbose output. Heads up bestie: debug also gets passed down to the XML::RSS::Feed instances, so they start yapping too. Everything gets chatty. πŸ—£οΈ
  • tmpdir β€” this argument gets passed along to XML::RSS::Feed as the directory used to cache RSS between fetches (and between instances). So it remembers stuff between runs. Memory of an elephant, fr fr. 🐘
  • http_alias β€” Optional. The alias of an existing PoCoCl::HTTP.
  • follow_redirects β€” Optional. Only relevant if you don't already have an existing PoCoCl::HTTP. This argument gets passed to PoCoCl::HTTP to tell it what redirect-following level to use. (Defaults to 2.)

πŸ’… METHODS πŸ’…

  • $rssagg->feed_list β€” hands you back the current feeds as an array or an array_ref. Whatever you're in the mood for. 😌
  • $rssagg->feeds β€” returns a hash ref of feeds, where the key is the feed's name. That hash reference living under each key is the one passed to XML::RSS::Feed->new($hash_ref). (see XML::RSS::Feed)
  • $rssagg->feed( $feed_name ) β€” accessor, so you can grab a XML::RSS::Feed object by the feed's name.
  • $rssagg->add_feed( $hash_ref ) β€” the hash reference you pass in here gets passed to XML::RSS::Feed->new($hash_ref). (see XML::RSS::Feed)
  • $rssagg->remove_feed( $feed_name ) β€” pass in the name of the feed you want gone. Bye babe. πŸ‘‹
  • $rssagg->pause_feed( $feed_name ) β€” pass in the name of the feed you want to pause. Not a block, just a pause, it's a boundary thing.
  • $rssagg->resume_feed( $feed_name ) β€” pass in the name of the feed you want to resume (the one you paused earlier, you know the one).
  • $rssagg->shutdown β€” shuts down the instance of PoCo::RSSAggregator. Closing time, lights off. πŸŒ™

πŸ‘‘ AUTHOR πŸ‘‘

Jeff Bisbee, "<jbisbee at cpan.org>" β€” the originator, the main character, the blueprint. 🫑


πŸ’€ BUGS πŸ’€

Please report any bugs or feature requests to "bug-poe-component-rssaggregator at rt.cpan.org", or through the web interface at <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=POE-Component-RSSAggregator>.

Here's the deal: he gets notified, and then you automatically get notified of progress on your bug as he makes changes. It's a whole closed loop, very mutual, very communicative. πŸ’Œ


🌈 SUPPORT 🌈

You can find documentation for this module with the perldoc command:

perldoc POE::Component::RSSAggregator

You can also look for information at:

  • AnnoCPAN: Annotated CPAN documentation

<http://annocpan.org/dist/POE-Component-RSSAggregator>

  • CPAN Ratings

<http://cpanratings.perl.org/d/POE-Component-RSSAggregator>

  • RT: CPAN's request tracker

<http://rt.cpan.org/NoAuth/Bugs.html?Dist=POE-Component-RSSAggregator>

  • Search CPAN

<http://search.cpan.org/dist/POE-Component-RSSAggregator>

Four whole places to go look things up. She's covered, bestie. πŸ“š


🧚 ACKNOWLEDGEMENTS 🧚

Special thanks to Rocco Caputo, Martijn van Beers, Sean Burke, Prakash Kailasa and Randal Schwartz for their help, guidance, patience, and bug reports.

And to quote the man himself: guys thanks for actually taking time to use the code and give good, honest feedback. πŸ₯ΉπŸ’– Genuinely the sweetest thing on the whole page.


Copyright 2006 Jeff Bisbee, all rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.


πŸ¦‹ SEE ALSO πŸ¦‹

XML::RSS::Feed, XML::RSS::Headline, XML::RSS::Headline::PerlJobs, XML::RSS::Headline::Fark


and that's the whole page, bestie!! πŸ’– this one's perl v5.34.0, dated 2022-06-17, straight from the User Contributed Perl Documentation β€” go watch some feeds and slay. πŸŽ€βœ¨πŸ«Ά

πŸ“¦ where this page comes from