From 1002bb1c28a6fac71b2360782305e45bae0dd072 Mon Sep 17 00:00:00 2001 From: Antoine Jacquet Date: Sun, 24 Nov 2002 00:00:00 +0100 Subject: [PATCH] version 0.43 * manpage was added * increased number of users * "blue" theme was added * improved Makefile --- Makefile | 16 ++++++++-- README | 4 +-- irssistats.1 | 84 ++++++++++++++++++++++++++++++++++++++++++++++++++++ irssistats.c | 24 +++++++++++---- 4 files changed, 118 insertions(+), 10 deletions(-) create mode 100644 irssistats.1 diff --git a/Makefile b/Makefile index a3eae00..e6e091b 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,9 @@ +PRE = /usr/local +BIN = $(PRE)/bin +PIX = $(PRE)/share/irssistats/pix +DOC = $(PRE)/doc/irssistats +MAN = $(PRE)/man/man1 + irssistats:irssistats.c gcc -o irssistats irssistats.c @@ -5,7 +11,13 @@ clean: rm -f irssistats install:irssistats - (test -d /usr/local/bin && cp irssistats /usr/local/bin) || (test -d /usr/bin && cp irssistats /usr/bin) + mkdir -p $(BIN) $(PIX) $(DOC) $(MAN) + cp -f irssistats $(BIN) + cp -f pix/* $(PIX) + cp -f COPYING README sample.nickfile.txt $(DOC) + cp -f irssistats.1 $(MAN) uninstall: - rm -f /usr/local/bin/irssistats /usr/bin/irssistats + rm -f $(BIN)/irssistats + rm -rf $(PIX) $(DOC) + rm -f $(MAN)/irssistats.1 diff --git a/README b/README index 67ca6e8..d13d480 100644 --- a/README +++ b/README @@ -1,10 +1,10 @@ -irssistats 0.42 +irssistats 0.43 site: http://royale.zerezo.com/programmation/irssistats/ mail: royale@zerezo.com install: make -cp pix/*.png /path/to/webdir/ +cp pix/* /path/to/webdir/ usage: cat /path/to/file.log | ./irssistats \#channel maintainer language theme [nickfile] > /path/to/webdir/index.html diff --git a/irssistats.1 b/irssistats.1 new file mode 100644 index 0000000..21230cd --- /dev/null +++ b/irssistats.1 @@ -0,0 +1,84 @@ +.TH irssistats 1 23-Nov-2002 "version 0.43" irssistats + +.SH NAME +irssistats - A tool to generate HTML IRC stats based on irssi logs. + +.SH SYNOPSIS +cat /path/to/file.log | \fBirssistats\fP \fI\\#channel\fP \fImaintainer\fP \fIlanguage\fP \fItheme\fP \fI[nickfile]\fP > /path/to/webdir/index.html + +.SH DESCRIPTION +\fBirssistats\fP is a tool that make HTML stats from \fIirssi\fP logfiles. +.PP +It works like a filter (it reads data in input and produces the HTML page on the output). +.PP +The statistics generated display many useful and funny informations about the channel. + +.SH USING IT +First you need to copy the images needed for the HTML page : +.PP +.B cp /usr/share/irssistats/pix/* /path/to/webdir/ +.PP +Now you can generate the statistics for your channel : +.PP +.B cat /path/to/file.log | irssistats \\\\#channel maintainer language theme [nickfile] > /path/to/webdir/index.html +.PP +The logfiles for \fIirssi\fP are usually located in "~/irclogs/network/channel.log" + +.SH COMMAND LINE OPTIONS +All the options (except the nickfile) are mandatory and have to be set at the good place on the command line. +.PP +If you make any mistake on the command line, \fBirssistats\fP will remind you the usage. +.PP +Launching \fBirssistats\fP without any parameters is a good way to show the available options. +.PP +.TP 8 +.B \\\\#channel +Specifies the name of the channel you are parsing. Don't forget to escape the '#' character in the channel name. +.TP 8 +.B maintainer +Nickname of the person generating the statistics (you !). +.TP 8 +.B language +Language you want to use to display the statistics (example : "en" for english). +.TP 8 +.B theme +Theme (colors) to use for the statistics (example : "default" for the default theme). +.TP 8 +.B nickfile +This is the only optional argument. Specifies an alias file for nicks. See Below. + +.SH NICKFILE +Since version 0.4 of \fBirssistats\fP, you can use a nickfile to specify nicks to join. +.PP +Each line of the nickfile contains the final nick and a regular expression. +.PP +Examples : +.TP 8 +.B royale ^[Rr]oyale +join nicks starting with "Royale" or "royale" to the final nick "royale" +.TP 8 +.B royale ^antoine$ +also join the nick "antoine" to the final nick "royale" +.TP 8 +.B djakette [Dd]ja +join any nick that contains "Dja" or "dja" to final nick "djakette" +.TP 8 +.B ^bot\\\\|royale$ +remove "bot|royale" from statistics +.PP +The nickfile must not contain any comments. +.PP +The final nick will remove matching nicks from all statistics, except from "Some URLs" and "Some topics"... +.PP +You can also take a look at the "sample.nickfile.txt" in this package (in "/usr/share/doc/irssistats/"). + +.SH SEE ALSO +irssi(1) + +.SH INFORMATIONS +You can find informations and updates of \fBirssistats\fP at \fIhttp://royale.zerezo.com/programmation/irssistats/\fP. +.PP +Report bugs to \fIroyale@zerezo.com\fP. + +.SH AUTHOR +Antoine Jacquet <\fIroyale@zerezo.com\fP> diff --git a/irssistats.c b/irssistats.c index b5792b1..284dcb9 100644 --- a/irssistats.c +++ b/irssistats.c @@ -11,7 +11,7 @@ #define W3C_LINK /* Config */ -#define MAXUSERS 5000 +#define MAXUSERS 10000 #define MAXNICKLENGTH 50 #define MAXLINELENGTH 2000 #define MAXQUOTELENGTH 100 @@ -23,7 +23,7 @@ #define MINWORDLENGTH 5 /* irssistats */ -#define VERSION "0.42" +#define VERSION "0.43" #define URL "http://royale.zerezo.com/programmation/irssistats/" /* Counters */ @@ -269,7 +269,7 @@ char *L(char *key) } /* Themes */ -#define NBTHEMES 5 +#define NBTHEMES 6 #define NBCOLORS 9 char *colors[NBTHEMES][NBCOLORS+1][2]= /* first key used for theme name/description and abbreviation */ { @@ -332,6 +332,18 @@ char *colors[NBTHEMES][NBCOLORS+1][2]= /* first key used for theme name/descript { "TITLE2", "#FF7700" }, { "BGTABLE", "#FFEEEE" }, { "BGTITLE", "#FF7700" } + }, + { /* Blue theme */ + { "Blue theme...", "blue" }, + { "BGCOLOR", "#FFFFFF" }, + { "TEXT", "#000000" }, + { "LINK", "#4444FF" }, + { "VLINK", "#8888FF" }, + { "ALINK", "#CCCCFF" }, + { "TITLE1", "#8888FF" }, + { "TITLE2", "#AAAAFF" }, + { "BGTABLE", "#EEEEFF" }, + { "BGTITLE", "#CCCCFF" } } }; @@ -543,12 +555,12 @@ int main(int argc,char *argv[]) /*** LOG ***/ srand(debut=time(NULL)); - fprintf(stderr,"working:"); + fprintf(stderr,"working on %s : ",channel); while (!feof(stdin)) { c=getchar(); line[pos++]=c; - if (pos>=MAXLINELENGTH) { fprintf(stderr,"line too long\n"); exit(1); } + if (pos>=MAXLINELENGTH) { fprintf(stderr,"line %d is too long\n",totallines); exit(1); } if (c=='\n') { line[pos-1]='\0'; @@ -684,7 +696,7 @@ int main(int argc,char *argv[]) pos=0; } } - fprintf(stderr,"done\n"); + fprintf(stderr," done\n"); bestwords(words,0); -- 2.20.1