[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ircnow perl library.


Hello Codeforce,

I've updated this library to include include some of the IO related functions from botnow into a new module.  The link for downloading the repo has changed to:

https://got.ircnow.org/cgi-bin/gotweb/gotweb?path=izzyb-IRCNOW-libs.git&action=summary

------------------------------

IRCNOW::IO

This library contains the functions from botnow related to reading/writing files and the debug() messages functions.  It provides to export tags to specify which functions to import.  Use it like this:

use IRCNOW::IO qw(:DEBUG);
$verbosity=INFO;

This loads the DEBUG related exports (constants NONE,ERRORS,WARNINGS,INFO,ALL; debug() and $verbosity variable). $verbosity is defined in IO.pm as our $verbosity=ERRORS;  Over ride by changing its value like above.

use IRCNOW::IO qw(:FILEIO);

This loads the FILEIO exports (readarray(), readstr(), writefire(), appendfile())

...Izzy

On 2023-05-20 11:10, izzyb wrote:
Hello Codeforce,

I started work on parsing log files for the BasicBot plugin and decided I needed a library to manage all the data sources for ircnow so I'm creating a library suite rooted at IRCNOW:: Currently, I have two Libraries

IRCNOW::Database

A library for managing the database connections and provides some useful generic functions for accessing and doing common tasks with database tables.

IRCNOW::ParseLog

A library and base class for log parsers. It is aware of and provides access methods for the database but I intend for it to also be useful just as a parsing engine of the raw log files.  Its currently dependent on IRCNOW::Database but plan to make it optional at some point.

My hope is it will make it easy to add new data sources and add to the data collection in a decentralized manner.  So each team can be responsible for their own data collection and retention policies while still enabling us to work together for policing abuse.  The library will make it easy to build tools like ponbot or the report script I added to botnow.  I'll update both to use the library.  The demo code included with the library imports new entries from the log into the database so botnow has access to them.  It'll be run via cron once this is ready to deploy.

This is probably at alpha level at best. Just wanted to share it seeing as its related to the Bot::BasicBot stuff I'm already sharing.  It may form the bases for a 300 level course for perl. ponBot will be the basis for the 200 level. That'll build on jrmu's perl 100 level that teaches perl through building a Bot::BasicBot.  End result will be a course that teaches perl through building an ircbot from simple perl using a library, to making it a Bot::BasicBot::Pluggable bot and building plugins for the bot to building a library to support data collection for the bot.  Lots more to do but its moving in a good direction :)

Here's the code:

https://got.ircnow.org/cgi-bin/gotweb/gotweb?path=IRCNOW-p5-lib&action=summary

I'm happy to receive comments or contributions.

...Izzy