]> iEval git - app-statsbot.git/blame - statsbot
Bump version and update Changes
[app-statsbot.git] / statsbot
CommitLineData
3cdbe256
MG
1#!/usr/bin/perl -w
2use v5.14;
3
4use App::Statsbot;
5use Getopt::Long;
6use sigtrap qw/die normal-signals/;
7
8GetOptions(
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,
17);
18
19App::Statsbot->run;
20
21__END__
22
23=encoding utf-8
24
25=head1 NAME
26
27statsbot - simple IRC bot that tracks time spent in a channel
28
29=head1 SYNOPSIS
30
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
fbde5e29
MG
36 # < mgv> BOTNICK, presence mgv
37 # < mgv> !help
38 # < mgv> BOTNICK: help
39 # < mgv> BOTNICK, help
3cdbe256
MG
40
41=head1 DESCRIPTION
42
43statsbot is a simple IRC bot that tracks the people that inhabit a
44channel. It is able to answer queries of the form "In the last <time
45interval>, how much time did <nick> spend in this channel?".
46
47It responds to queries of the form C<presence NICK [TIME
48[PRECISION]]>, optionally preceded by C<BOTNICK:> or C<BOTNICK,>.
49There can also be an optional "!" sign before the word "presence".
50
51where BOTNICK is the nickname of the bot, NICK is the nickname of a
52channel inhabitant, TIME is the interval that is considered, and
53PRECISION is the number of units to display. For example, if a
54PRECISION of 3 yields "1 hour, 2 minutes and 10 seconds", a PRECISION
55of 2 would yield "1 hour and 2 minutes" while a PRECISION of 1 would
56yield "1 hour".
57
58By default, the interval that is considered is one day and the result
59is displayed in hours.
60
61=head1 OPTIONS
62
63=over
64
65=item B<--debug>, B<--no-debug>
66
67If B<--debug>, prints some debug information. Defaults to B<--no-debug>.
68
69=item B<--tick>=I<60>
70
71How often (in seconds) to poll the channel for nicks. Defaults to 10
72seconds.
73
74=item B<--nickname>=I<"timebot">
75
76The nickname of the bot. Defaults to "statsbot".
77
78=item B<--server>=I<"irc.oftc.net">
79
80The IRC server. Defaults to "irc.freenode.net".
81
82=item B<--port>=I<6697>
83
84The port. Defaults to 6667.
85
86=item B<--ssl>, B<--no-ssl>.
87
88If B<--ssl>, connect via SSL. Defaults to B<--no-ssl>.
89
90=item B<--channel>=I<"#mychan">
91
92The channel that should be monitored. Multiple channels can be
93monitored by repeating this option.
94
95=item B<--db>=I</path/to/some/file.sqlite>
96
97Path to SQLite database. Must be writable. Will be created if it does
98not exist. Defaults to C</var/lib/statsbot/db>.
99
100=back
101
01dcdb69
MG
102=head1 ENVIRONMENT
103
104All 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.
105
106=over
107
108=item B<STATSBOT_DEBUG>=I<1>
109
110Equivalent to B<--debug>.
111
112=item B<STATSBOT_TICK>=I<60>
113
114Equivalent to B<--tick>=I<60>.
115
116=item B<STATSBOT_NICKNAME>=I<"timebot">
117
118Equivalent to B<--nickname>=I<"timebot">.
119
120=item B<STATSBOT_SERVER>=I<"irc.oftc.net">
121
122Equivalent to B<--server>=I<"irc.oftc.net">.
123
124=item B<STATSBOT_PORT>=I<6697>
125
126Equivalent to B<--port>=I<6697>.
127
128=item B<STATSBOT_SSL>=I<1>
129
130Equivalent to B<--ssl>.
131
132=item B<STATSBOT_CHANNELS>=I<"#mychan #otherchan">
133
134Equivalent to B<--channel>=I<#mychan> B<--channel>=I<#otherchan>.
135
136=item B<STATSBOT_DB>=I<"/path/to/some/file.sqlite">
137
138Equivalent to B<--db>=I<"/path/to/some/file.sqlite">.
139
140=back
141
3cdbe256
MG
142=head1 SEE ALSO
143
144L<App::Statsbot>
145
146=head1 AUTHOR
147
148Marius Gavrilescu, E<lt>marius@ieval.roE<gt>
149
150=head1 COPYRIGHT AND LICENSE
151
a5a81502 152Copyright (C) 2013-2016 by Marius Gavrilescu
3cdbe256
MG
153
154This library is free software; you can redistribute it and/or modify
155it under the same terms as Perl itself, either Perl version 5.20.2 or,
156at your option, any later version of Perl 5 you may have available.
157
158
159=cut
This page took 0.031408 seconds and 4 git commands to generate.