GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  POE::COMPONENT::RSSAGGREGATOR (3)

.ds Aq ’

NAME

POE::Component::RSSAggregator - Watch Muliple RSS Feeds for New Headlines

CONTENTS

VERSION

Version 1.11

SYNOPSIS



    #!/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";
        }
    }



CONSTRUCTORS

POE::Component::RSSAggregator->new( CW%hash );

Create a new instace of PoCo::RSSAggregator.
o alias

POE alias to use for your instance of PoCo::RSSAggregator.

o debug

Boolean value to turn on verbose output. (debug is also passed to XML::RSS::Feed instances to turn on verbose output as well)

o tmpdir

The tmpdir argument is passed on to XML::RSS::Feed as the directory to cache RSS between fetches (and instances).

o http_alias

Optional. Alias of an existing PoCoCl::HTTP.

o follow_redirects

Optional. Only if you don’t have an exiting PoCoCl::HTTP. Argument is passed to PoCoCl::HTTP to tell it the follow redirect level. (Defaults to 2)

METHODS

CW$rssagg->feed_list

Returns the current feeds as an array or array_ref.

CW$rssagg->feeds

Returns a hash ref of feeds with the key being the feeds name. The hash reference you that belongs to the key is passed to XML::RSS::Feed->new($hash_ref). ( see XML::RSS::Feed )

CW$rssagg->feed( CW$feed_name )

Accessor to access a the XML::RSS::Feed object via a feed’s name.

CW$rssagg->add_feed( CW$hash_ref )

The hash reference you pass in to add_feed is passed to XML::RSS::Feed->new($hash_ref). ( see XML::RSS::Feed )

CW$rssagg->remove_feed( CW$feed_name )

Pass in the name of the feed you want to remove.

CW$rssagg->pause_feed( CW$feed_name )

Pass in the name of the feed you want to pause.

CW$rssagg->resume_feed( CW$feed_name )

Pass in the name of the feed you want to resume (that you previously paused).

CW$rssagg->shutdown

Shutdown the instance of PoCo::RSSAggregator.

AUTHOR

Jeff Bisbee, <jbisbee at cpan.org>

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>. I will be notified, and then you’ll automatically be notified of progress on your bug as I make changes.

SUPPORT

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



    perldoc POE::Component::RSSAggregator



You can also look for information at:
o AnnoCPAN: Annotated CPAN documentation

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

o CPAN Ratings

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

o RT: CPAN’s request tracker

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

o Search CPAN

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

ACKNOWLEDGEMENTS

Special thanks to Rocco Caputo, Martijn van Beers, Sean Burke, Prakash Kailasa and Randal Schwartz for their help, guidance, patience, and bug reports. Guys thanks for actually taking time to use the code and give good, honest feedback.

COPYRIGHT & LICENSE

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
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 POE::COMPONENT::RSSAGGREGATOR (3) 2008-07-01

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.