]>
iEval git - app-statsbot.git/blob - statsbot
6 use sigtrap qw
/die normal-signals/ ;
9 'debug!' => \
$App :: Statsbot
:: DEBUG
,
10 'tick=i' => \
$App :: Statsbot
:: TICK
,
11 'nickname=s' => \
$App :: Statsbot
:: NICKNAME
,
12 'server=s' => \
$App :: Statsbot
:: SERVER
,
13 'port=i' => \
$App :: Statsbot
:: PORT
,
14 'ssl!' => \
$App :: Statsbot
:: SSL
,
15 'channel=s' => \
@App :: Statsbot
:: CHANNELS
,
16 'db=s' => \
$App :: Statsbot
:: DB
,
27 statsbot - simple IRC bot that tracks time spent in a channel
31 statsbot --nickname=sbot --channel='#somechan'
32 # Bot will respond to queries of the forms:
33 # < mgv> !presence mgv
34 # < mgv> presence mgv '1 day'
35 # < mgv> BOTNICK: !presence mgv '1 year' 2
36 # < mgv> BOTNICK, presence mgv
38 # < mgv> BOTNICK: help
39 # < mgv> BOTNICK, help
43 statsbot is a simple IRC bot that tracks the people that inhabit a
44 channel. It is able to answer queries of the form "In the last <time
45 interval>, how much time did <nick> spend in this channel?".
47 It responds to queries of the form C<presence NICK [TIME
48 [PRECISION]]>, optionally preceded by C<BOTNICK:> or C<BOTNICK,>.
49 There can also be an optional "!" sign before the word "presence".
51 where BOTNICK is the nickname of the bot, NICK is the nickname of a
52 channel inhabitant, TIME is the interval that is considered, and
53 PRECISION is the number of units to display. For example, if a
54 PRECISION of 3 yields "1 hour, 2 minutes and 10 seconds", a PRECISION
55 of 2 would yield "1 hour and 2 minutes" while a PRECISION of 1 would
58 By default, the interval that is considered is one day and the result
59 is displayed in hours.
65 =item B<--debug>, B<--no-debug>
67 If B<--debug>, prints some debug information. Defaults to B<--no-debug>.
71 How often (in seconds) to poll the channel for nicks. Defaults to 10
74 =item B<--nickname>=I<"timebot">
76 The nickname of the bot. Defaults to "statsbot".
78 =item B<--server>=I<"irc.oftc.net">
80 The IRC server. Defaults to "irc.freenode.net".
82 =item B<--port>=I<6697>
84 The port. Defaults to 6667.
86 =item B<--ssl>, B<--no-ssl>.
88 If B<--ssl>, connect via SSL. Defaults to B<--no-ssl>.
90 =item B<--channel>=I<"#mychan">
92 The channel that should be monitored. Multiple channels can be
93 monitored by repeating this option.
95 =item B<--db>=I</path/to/some/file.sqlite>
97 Path to SQLite database. Must be writable. Will be created if it does
98 not exist. Defaults to C</var/lib/statsbot/db>.
104 All options can be passed via the environment. If an option is passed both as an environment variable and as an argument, the argument takes priority.
108 =item B<STATSBOT_DEBUG>=I<1>
110 Equivalent to B<--debug>.
112 =item B<STATSBOT_TICK>=I<60>
114 Equivalent to B<--tick>=I<60>.
116 =item B<STATSBOT_NICKNAME>=I<"timebot">
118 Equivalent to B<--nickname>=I<"timebot">.
120 =item B<STATSBOT_SERVER>=I<"irc.oftc.net">
122 Equivalent to B<--server>=I<"irc.oftc.net">.
124 =item B<STATSBOT_PORT>=I<6697>
126 Equivalent to B<--port>=I<6697>.
128 =item B<STATSBOT_SSL>=I<1>
130 Equivalent to B<--ssl>.
132 =item B<STATSBOT_CHANNELS>=I<"#mychan #otherchan">
134 Equivalent to B<--channel>=I<#mychan> B<--channel>=I<#otherchan>.
136 =item B<STATSBOT_DB>=I<"/path/to/some/file.sqlite">
138 Equivalent to B<--db>=I<"/path/to/some/file.sqlite">.
148 Marius Gavrilescu, E<lt>marius@ieval.roE<gt>
150 =head1 COPYRIGHT AND LICENSE
152 Copyright (C) 2013-2016 by Marius Gavrilescu
154 This library is free software; you can redistribute it and/or modify
155 it under the same terms as Perl itself, either Perl version 5.20.2 or,
156 at your option, any later version of Perl 5 you may have available.
This page took 0.048329 seconds and 4 git commands to generate.