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.
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,
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,
Filter property can be set which will specify a class to be used as a customer POE::Filter for the event stream.
The isn't really any big reason that you would be wanting to instantiate a
but if it comes to that you do it by simply passing a list of the appropriate arguments to the
# Create the ammobot my $Bot = ThreatNet::Bot::AmmoBot->new( %args ); # Run the ammobot $Bot->run;
args accessor returns the argument hash.
tails accessor returns the
FollowTail objects indexed by file name.
running accessor returns true if the bot is currently running, or false if the bot has not yet started.
Once the bot has started, the
Session accessor provides direct access to the POE::Session object for the bot.
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.
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.
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.
- Add support for additional outbound filters
All bugs should be filed via the bug tracker at
For other issues, or commercial enhancement and support, contact the author
Adam Kennedy <email@example.com>
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.