Change log file for irssistats
+version 0.75 (2007-11-10)
+ * generate better/longer quotes when possible (patch by Nikolai Weh)
+
version 0.74 (2007-09-20)
* added CFLAGS to Makefile (patch by VMiklos)
* added '&' and '~' to list of nick prefix (patch by VMiklos)
/*
- * irssistats version 0.74
+ * irssistats version 0.75
*
* This tool generates IRC stats based on irssi logs.
* Usage: irssistats [/path/to/file.conf]
#define MINWORDLENGTH 5
/* irssistats */
-#define VERSION "0.74"
+#define VERSION "0.75"
#define URL "http://royale.zerezo.com/irssistats/"
/* Counters */
if (message[j-1]==')') users[i].counters[D_SMILE]++;
else if (message[j-1]=='(') users[i].counters[D_FROWN]++;
}
- if (rand()%users[i].lines==0) strncpy(users[i].quote,message,MAXQUOTELENGTH);
+ // Fetch a random message, messages between 25 and 70 chars are
+ // preferred (pisg-style, gets "better" quotes)
+ //
+ if (rand()%users[i].lines==0) {
+
+ int len = strlen(message);
+ // if we have a "good" quote, use it
+ if ( len > 25 && len < 70 )
+ {
+ strncpy(users[i].quote,message,MAXQUOTELENGTH);
+ } else {
+ int len2 = strlen(users[i].quote);
+ if ( !(len2 > 25 && len2 < 70 )) {
+ strncpy(users[i].quote,message,MAXQUOTELENGTH);
+ }
+ }
+ }
+
if (strncmp("http://",message,7)==0)
{
users[i].counters[D_URL]++;
int main(int argc,char *argv[])
{
(void) setlocale(LC_ALL, "");
-
if ((users=malloc(maxusers*sizeof(struct user)))==NULL) { fprintf(stderr,"unable to malloc memory\n"); exit(1); }
srand(debut=time(NULL));
if (argc==1) parse_config(NULL);
}
return(0);
}
+