Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

poe::component::irc::plugin::followtail(3pm) [debian man page]

POE::Component::IRC::Plugin::FollowTail(3pm)		User Contributed Perl Documentation	      POE::Component::IRC::Plugin::FollowTail(3pm)

NAME
POE::Component::IRC::Plugin::FollowTail - A PoCo-IRC plugin to follow the tail of an ever-growing file SYNOPSIS
use POE qw(Component::IRC Component::IRC::Plugin::FollowTail); my $nickname = 'Flibble' . $$; my $ircname = 'Flibble the Sailor Bot'; my $ircserver = 'irc.blahblahblah.irc'; my $filename = '/some/such/file/here'; my @channels = ( '#Blah', '#Foo', '#Bar' ); my $irc = POE::Component::IRC->spawn( nick => $nickname, server => $ircserver, port => $port, ircname => $ircname, ) or die "Oh noooo! $!"; POE::Session->create( package_states => [ main => [ qw(_start irc_001 irc_tail_input irc_tail_error irc_tail_reset) ], ], ); $poe_kernel->run(); sub _start { $irc->plugin_add( 'FollowTail' => POE::Component::IRC::Plugin::FollowTail->new( filename => $filename, )); $irc->yield( register => 'all' ); $irc->yield( connect => { } ); return; } sub irc_001 { $irc->yield( join => $_ ) for @channels; return; } sub irc_tail_input { my ($kernel, $sender, $filename, $input) = @_[KERNEL, SENDER, ARG0, ARG1]; $kernel->post( $sender, 'privmsg', $_, "$filename: $input" ) for @channels; return; } sub irc_tail_error { my ($kernel, $sender, $filename, $errnum, $errstring) = @_[KERNEL, SENDER, ARG0 .. ARG2]; $kernel->post( $sender, 'privmsg', $_, "$filename: ERROR: $errnum $errstring" ) for @channels; $irc->plugin_del( 'FollowTail' ); return; } sub irc_tail_reset { my ($kernel, $sender, $filename) = @_[KERNEL, SENDER, ARG0]; $kernel->post( $sender, 'privmsg', $_, "$filename: RESET EVENT" ) for @channels; return; } DESCRIPTION
POE::Component::IRC::Plugin::FollowTail is a POE::Component::IRC plugin that uses POE::Wheel::FollowTail to follow the end of an ever- growing file. It generates "irc_tail_" prefixed events for each new record that is appended to its file. METHODS
"new" Takes two arguments: 'filename', the name of the file to tail, mandatory; 'filter', a POE::Filter object to pass to POE::Wheel::FollowTail, optional; Returns a plugin object suitable for feeding to POE::Component::IRC's "plugin_add" method. OUTPUT EVENTS
The plugin generates the following additional POE::Component::IRC events: "irc_tail_input" Emitted for every complete record read. "ARG0" will be the filename, "ARG1" the record which was read. "irc_tail_error" Emitted whenever an error occurs. "ARG0" will be the filename, "ARG1" and "ARG2" hold numeric and string values for $!, respectively. "irc_tail_reset" Emitted every time a file is reset. "ARG0" will be the filename. AUTHOR
Chris 'BinGOs' Williams SEE ALSO
POE::Component::IRC POE::Wheel::FollowTail perl v5.14.2 2011-12-07 POE::Component::IRC::Plugin::FollowTail(3pm)

Check Out this Related Man Page

POE::Component::IRC::Plugin::NickReclaim(3pm)		User Contributed Perl Documentation	     POE::Component::IRC::Plugin::NickReclaim(3pm)

NAME
POE::Component::IRC::Plugin::NickReclaim - A PoCo-IRC plugin for reclaiming your nickname SYNOPSIS
use strict; use warnings; use POE qw(Component::IRC Component::IRC::Plugin::NickReclaim); my $nickname = 'Flibble' . $$; my $ircname = 'Flibble the Sailor Bot'; my $ircserver = 'irc.blahblahblah.irc'; my $port = 6667; my $irc = POE::Component::IRC->spawn( nick => $nickname, server => $ircserver, port => $port, ircname => $ircname, ) or die "Oh noooo! $!"; POE::Session->create( package_states => [ main => [ qw(_start) ], ], ); $poe_kernel->run(); sub _start { $irc->yield( register => 'all' ); # Create and load our NickReclaim plugin, before we connect $irc->plugin_add( 'NickReclaim' => POE::Component::IRC::Plugin::NickReclaim->new( poll => 30 ) ); $irc->yield( connect => { } ); return; } DESCRIPTION
POE::Component::IRC::Plugin::NickReclaim - A POE::Component::IRC plugin automagically deals with your bot's nickname being in use and reclaims it when it becomes available again. It registers and handles 'irc_433' events. On receiving a 433 event it will reset the nickname to the 'nick' specified with "spawn" or "connect", appendedwith an underscore, and then poll to try and change it to the original nickname. If someone in your channel who has the nickname you're after quits or changes nickname, the plugin will try to reclaim it immediately. METHODS
"new" Takes one optional argument: 'poll', the number of seconds between nick change attempts, default is 30; Returns a plugin object suitable for feeding to POE::Component::IRC's "plugin_add" method. AUTHOR
Chris 'BinGOs' Williams With amendments applied by Zoffix Znet SEE ALSO
POE::Component::IRC perl v5.14.2 2011-12-07 POE::Component::IRC::Plugin::NickReclaim(3pm)
Man Page