From: Antoine Jacquet Date: Fri, 18 Oct 2002 22:00:00 +0000 (+0200) Subject: version 0.41 X-Git-Tag: v0.41 X-Git-Url: http://royale.zerezo.com/git/?a=commitdiff_plain;h=21bd986e12060b48653b3718250b6ead6b75715f;p=irssistats version 0.41 * polish support (thank you Piotr Jarmuz) * you can now ignore some users * improved Makefile * the # in channel name is not imposed anymore (to support "&channels") * number of total days are now displayed --- diff --git a/Makefile b/Makefile index 1e9ff5b..a3eae00 100644 --- a/Makefile +++ b/Makefile @@ -1,2 +1,11 @@ irssistats:irssistats.c gcc -o irssistats irssistats.c + +clean: + rm -f irssistats + +install:irssistats + (test -d /usr/local/bin && cp irssistats /usr/local/bin) || (test -d /usr/bin && cp irssistats /usr/bin) + +uninstall: + rm -f /usr/local/bin/irssistats /usr/bin/irssistats diff --git a/README b/README index 01aaf4f..0a2c7be 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -irssistats 0.4 +irssistats 0.41 site: http://royale.zerezo.com/programmation/irssistats/ mail: royale@zerezo.com @@ -7,16 +7,19 @@ make cp pix/*.png /path/to/webdir/ usage: -cat /path/to/file.log | ./irssistats channel maintainer language theme [nickfile] > /path/to/webdir/index.html +cat /path/to/file.log | ./irssistats \#channel maintainer language theme [nickfile] > /path/to/webdir/index.html +(don't forget to escape the '#' in the channel name) nickfile: Since version 0.4 of irssistats, you can use a nickfile to specify nicks to join. Each line of the nickfile contains the final nick and a regular expression. Examples : - royale ^[Rr]oyale : join nicks starting with "Royale" or "royale" to the final nick "royale" - royale ^antoine$ : also join the nick "antoine" to the final nick "royale" - djakette [Dd]ja : join any nick that contains "Dja" or "dja" to final nick "djakette" + royale ^[Rr]oyale : join nicks starting with "Royale" or "royale" to the final nick "royale" + royale ^antoine$ : also join the nick "antoine" to the final nick "royale" + djakette [Dd]ja : join any nick that contains "Dja" or "dja" to final nick "djakette" + ^bot\|royale$ : remove "bot|royale" from statistics The nickfile must not contain any comments. +The final nick will remove matching nicks from all statistics, except from "Some URLs" and "Some topics"... You can also take a look at the "sample.nickfile.txt" in this package. links: diff --git a/irssistats.c b/irssistats.c index b7a855c..1ddd0cc 100644 --- a/irssistats.c +++ b/irssistats.c @@ -1,4 +1,4 @@ -/* Usage: cat /path/to/file.log | ./irssistats channel maintainer language theme [nickfile] > /path/to/file.html */ +/* Usage: cat /path/to/file.log | ./irssistats \#channel maintainer language theme [nickfile] > /path/to/file.html */ #include #include @@ -19,7 +19,7 @@ #define MINWORDLENGTH 5 /* irssistats */ -#define VERSION "0.4" +#define VERSION "0.41" #define URL "http://royale.zerezo.com/programmation/irssistats/" /* Counters */ @@ -40,13 +40,13 @@ char *counters[NBCOUNTERS]={"C_SMILE","C_FROWN","C_EXCLAM","C_QUESTION","C_ME","C_TOPIC","C_MODE","C_KICK","C_KICKED","C_URL","C_JOIN","C_NICK","C_MONOLOGUE"}; /* Languages */ -#define NBLANGUAGES 4 +#define NBLANGUAGES 5 #define NBKEYS 38 char *keys[NBLANGUAGES][NBKEYS+1][2]= /* first key used for language name and abbreviation */ { { /* English language */ { "English", "en" }, - { "HEADER", "Statistics for #%s by %s" }, + { "HEADER", "Statistics for %s by %s" }, { "LEGEND", "Legend" }, { "LASTDAYS", "Lastdays statistics" }, { "TOPHOURS", "Hourly statistics" }, @@ -69,7 +69,7 @@ char *keys[NBLANGUAGES][NBKEYS+1][2]= /* first key used for language name and ab { "OCCURRENCES", "occurrences" }, { "BIGNUMBERS", "Some big numbers..." }, { "NUMBERS", "numbers" }, - { "TIME", "%d lines parsed in %d seconds" }, + { "TIME", "%d lines (%d days) parsed in %d seconds" }, { "FOOTER", "Statistics generated by" }, { "C_SMILE", "is often happy :)" }, { "C_FROWN", "is often sad :(" }, @@ -87,7 +87,7 @@ char *keys[NBLANGUAGES][NBKEYS+1][2]= /* first key used for language name and ab }, { /* French language */ { "Français", "fr" }, - { "HEADER", "Statistiques de #%s par %s" }, + { "HEADER", "Statistiques de %s par %s" }, { "LEGEND", "Légende" }, { "LASTDAYS", "Statistiques des derniers jours" }, { "TOPHOURS", "Statistiques horaires" }, @@ -110,7 +110,7 @@ char *keys[NBLANGUAGES][NBKEYS+1][2]= /* first key used for language name and ab { "OCCURRENCES", "occurrences" }, { "BIGNUMBERS", "Quelques grands nombres..." }, { "NUMBERS", "nombres" }, - { "TIME", "%d lignes traitées en %d secondes" }, + { "TIME", "%d lignes (%d jours) traitées en %d secondes" }, { "FOOTER", "Statistiques générées par" }, { "C_SMILE", "est souvent heureux :)" }, { "C_FROWN", "est souvent triste :(" }, @@ -129,7 +129,7 @@ char *keys[NBLANGUAGES][NBKEYS+1][2]= /* first key used for language name and ab { /* German language */ /* contributed by Valentin Gelhorn */ { "German", "de" }, - { "HEADER", "Statistiken für #%s von %s" }, + { "HEADER", "Statistiken für %s von %s" }, { "LEGEND", "Legende" }, { "LASTDAYS", "Statistik der letzten Tage" }, { "TOPHOURS", "Stündliche Statistik" }, @@ -152,7 +152,7 @@ char *keys[NBLANGUAGES][NBKEYS+1][2]= /* first key used for language name and ab { "OCCURRENCES", "Vorkommen" }, { "BIGNUMBERS", "Ein paar grosse Zahlen" }, { "NUMBERS", "Zahlen" }, - { "TIME", "%d Zeilen analysiert in %d Sekunden" }, + { "TIME", "%d Zeilen (%d Tage) analysiert in %d Sekunden" }, { "FOOTER", "Statistiken wurden erstellt von" }, { "C_SMILE", "ist oft glüklich :)" }, { "C_FROWN", "ist oft traurig :(" }, @@ -171,7 +171,7 @@ char *keys[NBLANGUAGES][NBKEYS+1][2]= /* first key used for language name and ab { /* Spanish language */ /* contributed by Alex */ { "Spanish", "es" }, - { "HEADER", "Estadísticas de #%s por %s" }, + { "HEADER", "Estadísticas de %s por %s" }, { "LEGEND", "Leyenda" }, { "LASTDAYS", "Estadísticas de los últimos días" }, { "TOPHOURS", "Estadísticas por horas" }, @@ -194,7 +194,7 @@ char *keys[NBLANGUAGES][NBKEYS+1][2]= /* first key used for language name and ab { "OCCURRENCES", "Frecuencia" }, { "BIGNUMBERS", "Algunos datos..." }, { "NUMBERS", "Número de veces" }, - { "TIME", "%d lineas procesadas en %d segundos" }, + { "TIME", "%d lineas (%d días) procesadas en %d segundos" }, { "FOOTER", "Estadísticas generadas por" }, { "C_SMILE", "Suele estar felíz :)" }, { "C_FROWN", "Suele estar triste :(" }, @@ -209,6 +209,48 @@ char *keys[NBLANGUAGES][NBKEYS+1][2]= /* first key used for language name and ab { "C_JOIN", "No sabe si irse o quedarse" }, { "C_NICK", "Cambia mucho de nick" }, { "C_MONOLOGUE", "Habla solo" } + }, + { /* Polish language */ + /* contributed by Piotr Jarmuz */ + { "Polish", "pl" }, + { "HEADER", "Statystyki dla %s przez %s" }, + { "LEGEND", "Legenda" }, + { "LASTDAYS", "Statystyki z ostatnich dni" }, + { "TOPHOURS", "Statystyki godzinne" }, + { "TOPUSERS", "Najaktywniejsi ludzie" }, + { "OTHERS", "Zostalo jeszcze %d nie sklasyfikowanych..." }, + { "NBLINES", "linie" }, + { "NICK", "nick" }, + { "AVGLETTERS", "litery/linie" }, + { "HOURS", "godziny" }, + { "QUOTE", "przypadkowa wiadomosc" }, + { "TOPUSERSTIME", "Najaktywniejsi ludzie wedlug czasu dnia" }, + { "RANDTOPICS", "Pare tematow" }, + { "CHANGEDBY", "zmienione przez" }, + { "NEWTOPIC", "nowy temat" }, + { "RANDURLS", "Pare URL-i" }, + { "POSTEDBY", "wyslane przez" }, + { "POSTEDURL", "URL" }, + { "TOPWORDS", "Najczestsze slowa" }, + { "WORD", "slowo" }, + { "OCCURRENCES", "wystapienia" }, + { "BIGNUMBERS", "Pare wielkich liczb..." }, + { "NUMBERS", "liczby" }, + { "TIME", "%d linii (%d dni) sparsowanych w %d sekund" }, + { "FOOTER", "Statystyki wygenerowane przez" }, + { "C_SMILE", "jest czesto szczesliwy :)" }, + { "C_FROWN", "jest czesto smutny :(" }, + { "C_EXCLAM", "duzo krzyczy !" }, + { "C_QUESTION", "zadaje duzo pytan ?" }, + { "C_ME", "lubi /mnie polecenie" }, + { "C_TOPIC", "czesto zmienia temat" }, + { "C_MODE", "czesto zmienia tryb" }, + { "C_KICK", "lubi /kopac" }, + { "C_KICKED", "czesto go wykopuja" }, + { "C_URL", "wysyla duzo URL-i" }, + { "C_JOIN", "nie wie czy zostac czy wyjsc" }, + { "C_NICK", "czesto zmienia swojego nicka" }, + { "C_MONOLOGUE", "czesto mowi monologiem" } } }; @@ -468,7 +510,7 @@ int main(int argc,char *argv[]) if ((argc<5) || (argc>6)) { - fprintf(stderr,"Usage: cat /path/to/file.log | ./irssistats channel maintainer language theme [nickfile] > /path/to/file.html\n\n"); + fprintf(stderr,"Usage: cat /path/to/file.log | ./irssistats \\#channel maintainer language theme [nickfile] > /path/to/file.html\n\n"); fprintf(stderr,"Version :\nirssistats %s\n\n",VERSION); fprintf(stderr,"Supported languages :\n"); for (i=0;i"); + users[i].lines=-1; + users[i].letters=-1; + for (j=0;j<4;j++) users[i].hours[j]=-1; + for (j=0;j\n

\n\n"); /* footer */ - printf(L("TIME"),totallines,(int)(time(NULL)-debut)); + printf(L("TIME"),totallines,days,(int)(time(NULL)-debut)); printf("
\n%s irssistats %s",L("FOOTER"),URL,VERSION); printf("\n\n\n\n\n\n\n"); diff --git a/sample.nickfile.txt b/sample.nickfile.txt index 25d6d2d..67d92d3 100644 --- a/sample.nickfile.txt +++ b/sample.nickfile.txt @@ -1,3 +1,5 @@ + ^bot\|royale$ + royale ^royale royale ^antoine @@ -7,16 +9,18 @@ sektor ^guillaume Skorn ^Skorn -ed- ^ed -ed- ^fionna -ed- ^voyager -ed- ^laurent +ed ^ed +ed ^fionna +ed ^[Vv]oyager +ed ^laurent -Baloo ^Baloo +eL^Cheator el\^cheator -DocJ [Dd]oc[Jj] +Baloo ^Baloo Connard ^Connard +Connard ^Julien +Connard ^LedZep Trash ^Trash @@ -26,32 +30,35 @@ vinc ^vinc Clak ^Clak -N4in N4in - Kin ^Kin -J377 J377 - -SpetsnaZ ^SpetsnaZ -SpetsnaZ Spets - -eXistenZ e[Xx]isten[Zz] +eXistenZ ^e[Xx]isten[Zz] tit-namour ^tit -Domitille Domi -Domitille Domy -Domitille Mimitille +Domitille ^Domi +Domitille ^Domy +Domitille ^Mimitille Kalimero ^Jo\[zeRezo\] -Djakette [Dd]jakette +Djakette ^[Dd]jakette Djakette ^\[BTF\]Dja Djakette ^FonsD\|Dja Djakette ^dja piTi``kOrB` ^piTi``kOrB` +DocJ ^[Dd]oc[Jj] + +SpetsnaZ ^SpetsnaZ +SpetsnaZ Spets + Clowny Clowny -toul toul \ No newline at end of file +N4in N4in + +J377 J377 + +toul toul +toul ^\[BTF\]