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::IRC::PLUGIN::RSS::HEADLINES (3)

.ds Aq ’

NAME

POE::Component::IRC::Plugin::RSS::Headlines - A POE::Component::IRC plugin that provides RSS headline retrieval.

CONTENTS

SYNOPSIS



  use strict;
  use warnings;
  use POE qw(Component::IRC Component::IRC::Plugin::RSS::Headlines);

  my $nickname = RSSHead . $$;
  my $ircname = RSSHead the Sailor Bot;
  my $ircserver = irc.perl.org;
  my $port = 6667;
  my $channel = #IRC.pm;
  my $rss_url = http://eekeek.org/jerkcity.cgi;

  my $irc = POE::Component::IRC->spawn(
        nick => $nickname,
        server => $ircserver,
        port => $port,
        ircname => $ircname,
        debug => 0,
        plugin_debug => 1,
        options => { trace => 0 },
  ) or die "Oh noooo! $!";

  POE::Session->create(
        package_states => [
                main => [ qw(_start irc_001 irc_join irc_rssheadlines_items) ],
        ],
  );

  $poe_kernel->run();
  exit 0;

  sub _start {
    # Create and load our plugin
    $irc->plugin_add( RSSHead =>
        POE::Component::IRC::Plugin::RSS::Headlines->new() );

    $irc->yield( register => all );
    $irc->yield( connect => { } );
    undef;
  }

  sub irc_001 {
    $irc->yield( join => $channel );
    undef;
  }

  sub irc_join {
    my ($kernel,$sender,$channel) = @_[KERNEL,SENDER,ARG1];
    print STDERR "$channel $rss_url\n";
    $kernel->yield( get_headline, { url => $rss_url, _channel => $channel } );
    undef;
  }

  sub irc_rssheadlines_items {
    my ($kernel,$sender,$args) = @_[KERNEL,SENDER,ARG0];
    my $channel = delete $args->{_channel};
    $kernel->post( $sender, privmsg, $channel, join( , @_[ARG1..$#_] ) );
    undef;
  }



DESCRIPTION

POE::Component::IRC::Plugin::RSS::Headlines, is a POE::Component::IRC plugin that provides a mechanism for retrieving RSS headlines from given URLs.

CONSTRUCTOR

new Creates a new plugin object. Takes the following optional arguments:



  http_alias, you may provide the alias of an existing POE::Component::Client::HTTP
                component that the plugin will use instead of spawning its own;
  follow_redirects, this argument is passed to PoCoCl::HTTP to inform it how to deal with
                following redirects, default is 2;



INPUT EVENTS

The plugin registers the following state handler within your session:
get_headline Takes a hashref as an argument with the following keys:



  url, the RSS based url to retrieve items for;



You may pass arbitary key/value pairs, but the keys must be prefixed with an underscore.

OUTPUT

The following irc event is generated with the result of a ’get_headline’ command:
irc_rssheadlines_items Has the following parameters:



  ARG0, the original hashref that was passed;
  ARG1 .. $#_, RSS headline item titles;



irc_rssheadlines_error Has the following parameters:



  ARG0, the original hashref that was passed;
  ARG1, the error text;



AUTHOR

Chris ’BinGOs’ Williams

LICENSE

Copyright X Chris Williams

This module may be used, modified, and distributed under the same terms as Perl itself. Please see the license that came with your Perl distribution for details.

SEE ALSO

POE::Component::IRC
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 POE::COMPONENT::IRC::PLUGIN::RSS::HEADLINES (3) 2009-04-17

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