The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

App::Statsbot - simple IRC bot that tracks time spent in a channel

SYNOPSIS

  use App::Statsbot;
  @App::Statsbot::CHANNELS = '#oooes';
  $App::Statsbot::DEBUG = 1;
  App::Statsbot->run

  # Bot will respond to queries of the forms:
  # < mgv> !presence mgv
  # < mgv>   presence mgv '1 day'
  # < mgv> BOTNICK: !presence mgv '1 year' 2
  # < mgv> BOTNICK:    presence   mgv

DESCRIPTION

App::Statsbot is a simple IRC bot that tracks the people that inhabit a channel. It is able to answer queries of the form "In the last <time interval>, how much time did <nick> spend in this channel?".

It is configured via global variables in the App::Statsbot package. These variables are initialized from environment variables with names of the form STATSBOT_DEBUG, STATSBOT_TICK, etc. In the case of array variables, the environment variable is treated as a space separated list. Each configuration variable has a default value used when it is not set explicitly or via the environment.

$DEBUG

If true, print some debug information. Defaults to false.

$TICK

How often (in seconds) to poll the channel for nicks. Defaults to 10 seconds.

$NICKNAME

The nickname of the bot. Defaults to "statsbot".

$SERVER

The IRC server. Defaults to "irc.freenode.net".

$PORT

The port. Defaults to 6667.

$SSL

If true, connect via SSL. Defaults to false.

@CHANNELS

Array of channels to connect to. Defaults to an empty array, which is not very useful.

$DB

Path to SQLite database. Must be writable. Will be created if it does not exist. Defaults to /var/lib/statsbot/db.

After configuration, the bot can be started using the run function, which can be called as either a regular function or a method.

SEE ALSO

statsbot

AUTHOR

Marius Gavrilescu, <marius@ieval.ro>

COPYRIGHT AND LICENSE

Copyright (C) 2013-2016 by Marius Gavrilescu

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.20.2 or, at your option, any later version of Perl 5 you may have available.