Adam Kennedy > ThreatNet-0.20 > ThreatNet::Bot::AmmoBot

Download:
ThreatNet-0.20.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  1
Open  0
View/Report Bugs
Module Version: 0.20   Source  

NAME ^

ThreatNet::Bot::AmmoBot - Tail threat messages from a file to ThreatNet

DESCRIPTION ^

ThreatNet::Bot::AmmoBot is the basic foot soldier of the ThreatNet bot ecosystem, fetching ammunition and bringing it to the channel.

It connects to a single ThreatNet channel, and then tails one or more files scanning for threat messages while following the basic channel rules.

When it sees a ThreatNet::Message::IPv4-compatible message appear at the end of the file, it will report it to the channel (subject to the appropriate channel rules).

Its main purpose is to make it as easy as possible to connect any system capable of writing a log file to ThreatNet. If an application can be configured or coded to spit out the appropriately formatted messages to a file, then ammobot will patiently watch for them and then haul them off to the channel for you (so you don't have to).

It the data can be extracted from an existing file format, then a Filter property can be set which will specify a class to be used as a customer POE::Filter for the event stream.

METHODS ^

new %args

The isn't really any big reason that you would be wanting to instantiate a ThreatNet::Bot::AmmoBot yourself, but if it comes to that you do it by simply passing a list of the appropriate arguments to the new method.

  # Create the ammobot
  my $Bot = ThreatNet::Bot::AmmoBot->new( %args );
  
  # Run the ammobot
  $Bot->run;

args

The args accessor returns the argument hash.

tails

The tails accessor returns the HASH of FollowTail objects indexed by file name.

running

The running accessor returns true if the bot is currently running, or false if the bot has not yet started.

Session

Once the bot has started, the Session accessor provides direct access to the POE::Session object for the bot.

files

The files accessor returns a list of the files the bot is tailing (or will be tailing), or in scalar context returns the number of files.

add_file $file [, Filter => $POEFilter ]

Once you have created the Bot object, the add_file method is used to add the list of files that the bot will be tailing.

It takes as argument a file name, followed by a number of key/value parameters.

For the time being, the only available param is "Filter". The filter param provides a class name. The class will be loaded if needed, and then a new default object of it created and used as a custom POE::Filter for the file.

run

Once the bot has been created, and all of the files have been added, the run method is used to start the bot, and connect to the files and the IRC server.

The method dies if the bot has not had any files added.

TO DO ^

- Add support for additional outbound filters

SUPPORT ^

All bugs should be filed via the bug tracker at

http://rt.cpan.org/NoAuth/ReportBug.html?Queue=ThreatNet-Bot-AmmoBot

For other issues, or commercial enhancement and support, contact the author

AUTHORS ^

Adam Kennedy <adamk@cpan.org>

SEE ALSO ^

http://ali.as/devel/threatnetwork.html, POE

COPYRIGHT ^

Copyright (c) 2005 Adam Kennedy. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

The full text of the license can be found in the LICENSE file included with this module.

syntax highlighting: