• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

formats/H16-Sep-2001-343270

pipes/H03-May-2022-202139

AUTHORSH A D11-Aug-20011.9 KiB4130

COPYINGH A D01-Oct-199917.6 KiB341281

ChangeLogH A D16-Sep-20014.9 KiB13591

INSTALLH A D11-Nov-19997.6 KiB183143

Makefile.amH A D11-Aug-2001461 209

Makefile.inH A D16-Sep-200115.3 KiB514406

NEWSH A D16-Sep-20011.8 KiB5345

READMEH A D11-Mar-20001.7 KiB4430

README.log-formatsH A D16-Mar-20002.6 KiB6145

aclocal.m4H A D16-Sep-20014.3 KiB128113

config.h.inH A D20-Jul-2001946 4227

configureH A D16-Sep-200156.9 KiB1,8531,481

configure.inH A D16-Sep-2001878 3223

gruftistats.1H A D11-Aug-20013 KiB118111

gruftistats.specH A D16-Sep-2001933 4335

gruftistats.spec.inH A D16-Sep-2001935 4335

install-shH A D12-Jul-20005.5 KiB252153

ircstats.cH A D11-Aug-200151.3 KiB1,5431,297

ircstats.hH A D03-May-20223.7 KiB169119

lib.cH A D03-May-20222.9 KiB11159

log_regexp.cH A D21-Jul-20014.7 KiB139102

missingH A D12-Jul-20006.1 KiB191154

mkinstalldirsH A D12-Jul-2000722 4123

sample.confH A D11-Aug-2001636 2625

stamp-h.inH A D16-Sep-200110 21

text2html.cH A D21-Jul-20018.2 KiB336220

README

1gruftitats
2==========
3
4gruftistats is a program to read IRC logs. It produces a web page, with various
5statistics and quotes from the channel; the idea was got from the cool
6MircStats program.
7
8See the AUTHORS file for credits and contacting information. gruftistats is
9free software, see the file COPYING for details.
10
11Get the latest gruftistats information at
12http://gruftistats.sourceforge.net/
13
14Usage
15-----
16
17First compile (and if you want, install). This is covered in the INSTALL file.
18
19Next, get some IRC logs for your channel. gruftistats supports a few different
20log file formats, each described by a spec file. There are several such
21files supplied in the formats/ dir of this distribution (installed to
22/usr/local/share/gruftistats/). If there isn't one there for your client/bot,
23you can write one (TODO: document how :-).
24
25Next, copy the supplied sample.conf (installed to /usr/local/share/gruftistats)
26and adapt it for your channel. At least, set the channel name, and your name
27and email. The format is hopefully clear :-).
28
29Then, run gruftistats like so:
30
31gruftistats -r your_conf_file -p format_spec_file list_of_log_files > output.html
32
33Then fire up a browser and see the results. If you want to see the graphics,
34copy the .png graphics into the dir with the output.html (they are supplied
35in the pipes/ dir of this distribution, or installed to
36/usr/local/share/gruftistats/).
37
38For an example (or to be truthful to fit in a credit to the excellent text
39browser w3m, which was invaluable in testing gruftistats), here is how I would
40do a stats run on my BitchX log of #debian and read it in w3m:
41
42gruftistats -r /usr/local/share/gruftistats/sample.conf -p /usr/local/share/gruftistats/bitchx.lrx ~/.irclog.\#debian | w3m -T text/html
43
44

README.log-formats

1Writing a log format file
2-------------------------
3
4The first thing to do is try your logs with each of the existing format
5files in the formats/ dir. If any of them work even partly, that'll save you
6some work. bitchx.lrx is the most likely one.
7
8The next thing is to take a look at some of your logs. There are various
9things that are worth noting at once:
10
11- If each line in the log isn't time stamped, then gruftistats isn't going
12to like it. It may work, but you'll get meaningless crap in the time of day
13stuff. Look for an option in the program making the logs to enable time
14stamps.
15- There should be a date stamp at the start of the log, and at the turning
16of each day. This is definitely not essential, but without the per day usage
17will be boring :-).
18
19Gather a sample of lines from the log showing each of the following: normal
20text, actions (/me), kicks, joins, parts, quits, nick changes, topic sets,
21mode changes, and the data stamp.
22
23Now, what you need to write is a .lrx file. This will contain 1 line
24specifying the format of each of the above line types. The format of each
25line is:
26
27<line_type>=<line_regexp>,<name_part>,<name_part>,...
28
29Yes, it uses regular expressions. Yes, you might need to know regexps to do
30this. There are tutorials on the web; also some systems will discuss them in
31man egrep or man re_format.
32
33gruftistats has some build in stuff to make life easier:
34
35[[:nick:]]	matches any character that's legal in a nickname
36[[:uh:]]	matches any character that's legal in a user@host
37
38How it works is this: gruftistats tries to match each line in the log to
39each regexp in the .lrx. If the line matches none, it's ignored. (Use the
40-vvv for debugging, to see failed lines).
41
42If a line matches, gruftistats needs to which parts of the line are the
43nickname, the text, the time etc. That's where the name_part's some in.
44In the regexp, each variable part like the nickname and the text is
45bracketed. The name_part's correspond to the bracketed parts, and tell
46gruftistats what that part is.
47
48Example:
49
50text=^\[([0-9:]*)\] <([[:nick:]]*)> (.*)$,time,nick,string
51
52This says that normal text lines come in 3 parts in my log: a time (a string
53of digits and :'s) enclosed by []'s; a nickname enclosed by <>'s, and the
54rest of the string is the text typed. note that there are 3 pairs of ()'s on
55the left, one each for time, nick, text, and these are named as such by the
56",time,nick,string" at the end.
57
58Well that's about all I have to say. If this is all too much, just post some
59examples of your logs to the gruftistats bug tracking system, and wait for
60us to add a .lrx for you :-).
61