ThreatNet::Bot::AmmoBot - Tail threat messages from a file to ThreatNet
ThreatNet::Bot::AmmoBot is the basic foot soldier of the ThreatNet bot ecosystem, fetching ammunition and bringing it to the channel.
ThreatNet::Bot::AmmoBot
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).
ammobot
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.
Filter
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.
new
# Create the ammobot my $Bot = ThreatNet::Bot::AmmoBot->new( %args ); # Run the ammobot $Bot->run;
The args accessor returns the argument hash.
args
The tails accessor returns the HASH of FollowTail objects indexed by file name.
tails
HASH
FollowTail
The running accessor returns true if the bot is currently running, or false if the bot has not yet started.
running
Once the bot has started, the Session accessor provides direct access to the POE::Session object for the bot.
Session
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.
files
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.
add_file
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.
"Filter"
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.
run
The method dies if the bot has not had any files added.
- Add support for additional outbound filters
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
Adam Kennedy <adamk@cpan.org>
http://ali.as/devel/threatnetwork.html, POE
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.
To install ThreatNet, copy and paste the appropriate command in to your terminal.
cpanm
cpanm ThreatNet
CPAN shell
perl -MCPAN -e shell install ThreatNet
For more information on module installation, please visit the detailed CPAN module installation guide.