simbot-commits Mailing List for SimBot (Page 3)
Status: Abandoned
Brought to you by:
kstange
This list is closed, nobody may subscribe to it.
| 2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(88) |
Jun
(11) |
Jul
(64) |
Aug
(74) |
Sep
(1) |
Oct
(4) |
Nov
(12) |
Dec
(4) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2006 |
Jan
(7) |
Feb
(1) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(2) |
Sep
(3) |
Oct
(1) |
Nov
(4) |
Dec
|
| 2007 |
Jan
(5) |
Feb
(3) |
Mar
(1) |
Apr
(1) |
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2008 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Pete P. <fou...@us...> - 2005-10-14 01:56:52
|
Update of /cvsroot/simbot/simbot/plugins In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31638/plugins Modified Files: rss.pl Log Message: Remove feedburner redirects. This should fix the random re-announcing every entry in the feed. As an added bonus, users won't have to wait on a slow redirect. Index: rss.pl =================================================================== RCS file: /cvsroot/simbot/simbot/plugins/rss.pl,v retrieving revision 1.68 retrieving revision 1.69 diff -u -d -p -r1.68 -r1.69 --- rss.pl 7 May 2005 03:03:06 -0000 1.68 +++ rss.pl 14 Oct 2005 01:56:20 -0000 1.69 @@ -297,6 +297,10 @@ sub got_response { $last_update = time; } elsif($response->is_success) { $last_update = time; + $rss->add_module( + prefix => 'feedburner', + uri => 'http://rssnamespace.org/feedburner/ext/1.0', + ); if (!eval { $rss->parse($response->decoded_content); }) { &SimBot::debug(1, "rss: Parse error in $key: $@"); return; @@ -477,6 +481,10 @@ sub get_link_and_title { my $item = $_[0]; my $link = $item->{'link'}; my $title = $item->{'title'}; + + if(defined $item->{'feedburner'}->{'origLink'}) { + $link = $item->{'feedburner'}->{'origLink'}; + } $title = ($item->{'title'} ? $item->{'title'} : ""); $title = HTML::Entities::decode($title); |
|
From: Pete P. <fou...@us...> - 2005-10-14 01:33:39
|
Update of /cvsroot/simbot/simbot/plugins In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28523/plugins Modified Files: weather.pl Log Message: SimBot now understands NIL and gives a different useless response. Index: weather.pl =================================================================== RCS file: /cvsroot/simbot/simbot/plugins/weather.pl,v retrieving revision 1.105 retrieving revision 1.106 diff -u -d -p -r1.105 -r1.106 --- weather.pl 26 Jul 2005 00:58:48 -0000 1.105 +++ weather.pl 14 Oct 2005 01:33:31 -0000 1.106 @@ -381,10 +381,16 @@ sub got_metar { # Something is very weird about this METAR. It has no date, # so we are probably not going to get anything useful out of # it. - &SimBot::send_message(&SimBot::option('network', 'channel'), - "$nick: The METAR report for $station_name didn't make any sense to me. Try " + + my $msg; + if(defined $wxhash->{is_nil}) { + $msg = "$nick: No data is available for $station_name. Please try again later."; + } else { + $msg = "$nick: The METAR report for $station_name didn't make any sense to me. Try " . &SimBot::option('global', 'command_prefix') - . "metar $station if you want to try parsing it yourself."); + . "metar $station if you want to try parsing it yourself."; + } + &SimBot::send_message(&SimBot::option('network', 'channel'), $msg); return; } my ($wind_mph, $temp_f, $temp_c); @@ -914,6 +920,10 @@ sub parse_metar { # Station ID $weather_data{'station_id'} = $1; + } elsif($cur_block =~ m/^NIL$/) { # NIL + $weather_data{'is_nil'} = 1; + # there shouldn't be any data after a NIL (or before it), + # but we continue anyway just in case. } elsif($cur_block =~ m/^(\d{2})(\d{2})(\d{2})Z$/) { # DAY/TIME my $day = int $1; |
|
From: Kevin S. <ks...@us...> - 2005-09-07 04:20:59
|
Update of /cvsroot/simbot/simbot/plugins In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32728/plugins Modified Files: sqlite-logger.pl Log Message: When we have a bgcolor, use $bgcolor, not Index: sqlite-logger.pl =================================================================== RCS file: /cvsroot/simbot/simbot/plugins/sqlite-logger.pl,v retrieving revision 1.71 retrieving revision 1.72 diff -u -d -p -r1.71 -r1.72 --- sqlite-logger.pl 28 Aug 2005 19:11:01 -0000 1.71 +++ sqlite-logger.pl 7 Sep 2005 04:20:50 -0000 1.72 @@ -1282,7 +1282,7 @@ sub linkify { $reverse ? 'reverse ' : ( $color != -1 ? "color$color " : '' ) - . ( $bgcolor != -1 ? "bgcolor$color " : '' ) + . ( $bgcolor != -1 ? "bgcolor$bgcolor " : '' ) ); $tag .= "<span class=\"$class\">" if ( $class ne '' ); |
|
From: Pete P. <fou...@us...> - 2005-08-28 19:11:10
|
Update of /cvsroot/simbot/simbot/plugins In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21499/plugins Modified Files: sqlite-logger.pl Log Message: MODE is an event type and %seen * mode should now work. Index: sqlite-logger.pl =================================================================== RCS file: /cvsroot/simbot/simbot/plugins/sqlite-logger.pl,v retrieving revision 1.70 retrieving revision 1.71 diff -u -d -p -r1.70 -r1.71 --- sqlite-logger.pl 26 Aug 2005 07:45:38 -0000 1.70 +++ sqlite-logger.pl 28 Aug 2005 19:11:01 -0000 1.71 @@ -313,7 +313,7 @@ sub do_seen { while ( my $cur_arg = shift(@args) ) { if ( $cur_arg =~ - /(say|join|part|quit|nick|kick|notice|action|topic)/i ) + /(say|join|part|quit|nick|kick|notice|action|topic|mode)/i ) { my $cur_event = $1; if ( $cur_event =~ /^(join|part|kick)$/i ) { |
|
From: Kevin S. <ks...@us...> - 2005-08-26 07:45:47
|
Update of /cvsroot/simbot/simbot/plugins In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28911/plugins Modified Files: recap.pl sqlite-logger.pl Log Message: Rearrange some of the events a little bit to fix some weird problems: 1) Private "out" events were not reporting the destination, rendering them generally useless. 2) The callbacks for action events were being selected from the list of plugins that wanted message events, but called with the correct event, meaning plugins wanting actions but not messages would never get called. This wasn't causing any visible problems because plugins that ask for actions usually want messages also. 3) The arguments to the "in" and "out" events for actions were not the same, causing plugins assuming them to be to lose the first word or duplicate the nickname. The arguments now match those of the related normal message events. Index: recap.pl =================================================================== RCS file: /cvsroot/simbot/simbot/plugins/recap.pl,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -p -r1.22 -r1.23 --- recap.pl 10 Aug 2005 11:50:59 -0000 1.22 +++ recap.pl 26 Aug 2005 07:45:38 -0000 1.23 @@ -76,7 +76,7 @@ sub record_recap { if ($doing eq 'SAY') { $line .= "<$nick> $content"; } elsif ($doing eq 'ACTION') { - $line .= "* $content"; + $line .= "* $nick $content"; } elsif ($doing eq 'KICKED') { $line .= "$target kicked $nick from $channel" . ($content ? " ($content)" : ""); $departs{$nick} = 0; Index: sqlite-logger.pl =================================================================== RCS file: /cvsroot/simbot/simbot/plugins/sqlite-logger.pl,v retrieving revision 1.69 retrieving revision 1.70 diff -u -d -p -r1.69 -r1.70 --- sqlite-logger.pl 22 Aug 2005 17:26:53 -0000 1.69 +++ sqlite-logger.pl 26 Aug 2005 07:45:38 -0000 1.70 @@ -225,8 +225,6 @@ sub set_seen { # $target will be the arguments for the mode change options # let's add them to the content $content .= " $target"; - } elsif ( $doing eq 'ACTION' ) { - ( undef, $content ) = split( / /, $content, 2 ); } $insert_query->execute( time, $channel_id, $source_nick_id, $target_nick_id, |
|
From: Kevin S. <ks...@us...> - 2005-08-26 07:45:47
|
Update of /cvsroot/simbot/simbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28911 Modified Files: simbot.pl Log Message: Rearrange some of the events a little bit to fix some weird problems: 1) Private "out" events were not reporting the destination, rendering them generally useless. 2) The callbacks for action events were being selected from the list of plugins that wanted message events, but called with the correct event, meaning plugins wanting actions but not messages would never get called. This wasn't causing any visible problems because plugins that ask for actions usually want messages also. 3) The arguments to the "in" and "out" events for actions were not the same, causing plugins assuming them to be to lose the first word or duplicate the nickname. The arguments now match those of the related normal message events. Index: simbot.pl =================================================================== RCS file: /cvsroot/simbot/simbot/simbot.pl,v retrieving revision 1.138 retrieving revision 1.139 diff -u -d -p -r1.138 -r1.139 --- simbot.pl 11 Aug 2005 15:39:28 -0000 1.138 +++ simbot.pl 26 Aug 2005 07:45:38 -0000 1.139 @@ -204,12 +204,14 @@ our %event_channel_invite = (); # e ### Private Events ### # Private events get params: # (kernel, from, eventname, text) -our %event_private_message = (); # eventname = PRIVMSG (text) -our %event_private_message_out = (); # eventname = PRIVMSG (text) -our %event_private_action = (); # eventname = PRIVACTION (text) -our %event_private_action_out = (); # eventname = PRIVACTION (text) -our %event_private_notice = (); # eventname = NOTICE (text) -our %event_private_notice_out = (); # eventname = NOTICE (text) +our %event_private_message = (); # eventname = PRIVMSG () +our %event_private_action = (); # eventname = PRIVACTION () +our %event_private_notice = (); # eventname = NOTICE () + +# (kernel, from, dest, eventname, text) +our %event_private_message_out = (); # eventname = PRIVMSG () +our %event_private_action_out = (); # eventname = PRIVACTION () +our %event_private_notice_out = (); # eventname = NOTICE () ### Server Events ### # Server events get params: @@ -1519,7 +1521,7 @@ sub send_message { } } else { foreach(keys(%event_private_message_out)) { - &plugin_callback($_, $event_private_message_out{$_}, ($chosen_nick, 'PRIVMSG', $text)); + &plugin_callback($_, $event_private_message_out{$_}, ($chosen_nick, $dest, 'PRIVMSG', $text)); } } } @@ -1544,12 +1546,12 @@ sub send_action { &debug((3 + (!$public)), "[" . (@{$dest} ? "@{$dest}" : $dest) . ":$chosen_nick] [action] $chosen_nick $text\n"); if($public) { - foreach(keys(%event_channel_message_out)) { + foreach(keys(%event_channel_action_out)) { &plugin_callback($_, $event_channel_action_out{$_}, ($chosen_nick, $dest, 'ACTION', $text)); } } else { - foreach(keys(%event_private_message_out)) { - &plugin_callback($_, $event_private_action_out{$_}, ($chosen_nick, 'PRIVACTION', $text)); + foreach(keys(%event_private_action_out)) { + &plugin_callback($_, $event_private_action_out{$_}, ($chosen_nick, $dest, 'PRIVACTION', $text)); } } } @@ -1580,7 +1582,7 @@ sub send_notice { } } else { foreach(keys(%event_private_notice_out)) { - &plugin_callback($_, $event_private_notice_out{$_}, ($chosen_nick, 'NOTICE', $text)); + &plugin_callback($_, $event_private_notice_out{$_}, ($chosen_nick, $dest, 'NOTICE', $text)); } } } @@ -1810,12 +1812,12 @@ sub process_action { &build_records($text,"ACTION"); } foreach(keys(%event_channel_action)) { - &plugin_callback($_, $event_channel_action{$_}, ($nick, $channel, 'ACTION', "$nick $text")); + &plugin_callback($_, $event_channel_action{$_}, ($nick, $channel, 'ACTION', $text)); } } else { &debug(DEBUG_INFO, "[private:$nick] [action] $nick $text\n"); foreach(keys(%event_private_action)) { - &plugin_callback($_, $event_private_action{$_}, ($nick, 'PRIVACTION', "$nick $text")); + &plugin_callback($_, $event_private_action{$_}, ($nick, 'PRIVACTION', $text)); } } } |
|
From: Pete P. <fou...@us...> - 2005-08-22 17:27:04
|
Update of /cvsroot/simbot/simbot/plugins In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4708/plugins Modified Files: sqlite-logger.pl Log Message: Wildcard seens, try %seen FourOh* Index: sqlite-logger.pl =================================================================== RCS file: /cvsroot/simbot/simbot/plugins/sqlite-logger.pl,v retrieving revision 1.68 retrieving revision 1.69 diff -u -d -p -r1.68 -r1.69 --- sqlite-logger.pl 19 Aug 2005 00:31:52 -0000 1.68 +++ sqlite-logger.pl 22 Aug 2005 17:26:53 -0000 1.69 @@ -302,11 +302,10 @@ sub do_seen { # user is looking for anybody # we'll do nothing } elsif ( $seen_nick =~ m/\*/ ) { - # user is using wildcards - # FIXME: Later. - &SimBot::send_message( $channel, - "$nick: Sorry, wildcard matching is not implemented yet." ); - return; + my $nick_pattern = $seen_nick; + $nick_pattern =~ s/\*/%/; + $nick_list = 'SELECT id FROM names WHERE name LIKE "' + . $nick_pattern . '"'; } elsif ( !( $nick_list = &get_nickchan_id($seen_nick) ) ) { # The requested nick does not exist. &SimBot::send_message( $channel, |
|
From: Kevin S. <ks...@us...> - 2005-08-19 00:32:49
|
Update of /cvsroot/simbot/simbot/plugins In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12008/plugins Modified Files: sqlite-logger.pl Log Message: Support URLs containing colons (such as with port numbers) Index: sqlite-logger.pl =================================================================== RCS file: /cvsroot/simbot/simbot/plugins/sqlite-logger.pl,v retrieving revision 1.67 retrieving revision 1.68 diff -u -d -p -r1.67 -r1.68 --- sqlite-logger.pl 18 Aug 2005 23:10:09 -0000 1.67 +++ sqlite-logger.pl 19 Aug 2005 00:31:52 -0000 1.68 @@ -1312,7 +1312,7 @@ sub linkify { next; } - if ( $url =~ m{^((http|ftp|news|nntp|irc|aim)s?:[\w.?/=\-\&\~\;]+)} ) { + if ( $url =~ m{^((http|ftp|news|nntp|irc|aim)s?:[\w.?/=\-\&\~\;:]+)} ) { $curWord = qq($word_prefix<a href="$1">$word</a>$word_suffix); next; } |
|
From: Kevin S. <ks...@us...> - 2005-08-19 00:07:02
|
Update of /cvsroot/simbot/simbot/templates In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5973 Added Files: error.403.default.tmpl Log Message: I think it's appropriate to have 401, 403, 404, and 500 pages, at least. Since I am not adding payment or proxy support, I think we can safely ignore 402 and most of the rest of the 4xx errors. :) --- NEW FILE: error.403.default.tmpl --- <p>Access to the resource <q><TMPL_VAR NAME=request_url></q> was denied by its handler.</p> <p>Please verify the URL and try again. If you believe you should have access to this resource, please contact the administrator of this server.</p> |
|
From: Pete P. <fou...@us...> - 2005-08-18 23:42:01
|
Update of /cvsroot/simbot/simbot/templates In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2083 Modified Files: nick_stats.default.tmpl Log Message: Who deunicodified this? Index: nick_stats.default.tmpl =================================================================== RCS file: /cvsroot/simbot/simbot/templates/nick_stats.default.tmpl,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -p -r1.4 -r1.5 --- nick_stats.default.tmpl 18 Aug 2005 23:37:59 -0000 1.4 +++ nick_stats.default.tmpl 18 Aug 2005 23:41:20 -0000 1.5 @@ -26,7 +26,7 @@ <TMPL_IF NAME=action_count> <div class="linecount"><TMPL_VAR NAME=nick> has emoted <TMPL_VAR NAME=action_count> times, most recently:<br/> -⢠<TMPL_VAR NAME=nick> <TMPL_VAR NAME=action_content> +⢠<TMPL_VAR NAME=nick> <TMPL_VAR NAME=action_content> </div> </TMPL_IF> |
|
From: Pete P. <fou...@us...> - 2005-08-18 23:38:36
|
Update of /cvsroot/simbot/simbot/templates/css In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1586/css Modified Files: main.default.css Log Message: Move the CSS stuff into the CSS file. Index: main.default.css =================================================================== RCS file: /cvsroot/simbot/simbot/templates/css/main.default.css,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -p -r1.3 -r1.4 --- main.default.css 18 Aug 2005 18:38:52 -0000 1.3 +++ main.default.css 18 Aug 2005 23:37:59 -0000 1.4 @@ -21,6 +21,9 @@ div.linecount { background: #EEE; } +tr#hourgraphrow td { height: 10em; } +tr#hourgraphrow td div { background-color: #666; overflow: hidden; } + /* IRC LOG STYLES */ .ts { color: #777; |
|
From: Pete P. <fou...@us...> - 2005-08-18 23:38:34
|
Update of /cvsroot/simbot/simbot/templates In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1586 Modified Files: channel_stats.default.tmpl nick_stats.default.tmpl Log Message: Move the CSS stuff into the CSS file. Index: channel_stats.default.tmpl =================================================================== RCS file: /cvsroot/simbot/simbot/templates/channel_stats.default.tmpl,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -p -r1.3 -r1.4 --- channel_stats.default.tmpl 18 Aug 2005 23:19:34 -0000 1.3 +++ channel_stats.default.tmpl 18 Aug 2005 23:37:59 -0000 1.4 @@ -2,10 +2,10 @@ Copy to channel_stats.local.tmpl before editing --> <h4>Activity by Hour <TMPL_VAR NAME=timezone></h4> <table id="hourgraph"> -<tr valign="bottom"> +<tr valign="bottom" id="hourgraphrow"> <TMPL_LOOP NAME=hourloop> - <td style="height: 10em;"> - <div class="hour<TMPL_VAR NAME=hour>" style="height: <TMPL_VAR NAME="percent">%; background-color: #DDD; border: thin solid black; overflow: hidden;"> </div></td> + <td> + <div class="hour<TMPL_VAR NAME=hour>" style="height: <TMPL_VAR NAME="percent">%;"> </div></td> </TMPL_LOOP> </tr> <tr> Index: nick_stats.default.tmpl =================================================================== RCS file: /cvsroot/simbot/simbot/templates/nick_stats.default.tmpl,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -p -r1.3 -r1.4 --- nick_stats.default.tmpl 18 Aug 2005 23:19:34 -0000 1.3 +++ nick_stats.default.tmpl 18 Aug 2005 23:37:59 -0000 1.4 @@ -2,10 +2,10 @@ Copy to nick_stats.local.tmpl before editing --> <h4>Activity by Hour <TMPL_VAR NAME=timezone></h4> <table id="hourgraph"> -<tr valign="bottom"> +<tr valign="bottom" id="hourgraphrow"> <TMPL_LOOP NAME=hourloop> - <td style="height: 10em;"> - <div class="hour<TMPL_VAR NAME=hour>" style="height: <TMPL_VAR NAME="percent">%; background-color: #DDD; border: thin solid black; overflow: hidden;"> </div></td> + <td> + <div class="hour<TMPL_VAR NAME=hour>" style="height: <TMPL_VAR NAME="percent">%;"> </div></td> </TMPL_LOOP> </tr> <tr> |
|
From: Kevin S. <ks...@us...> - 2005-08-18 23:20:16
|
Update of /cvsroot/simbot/simbot/templates In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31143/templates Modified Files: channel_stats.default.tmpl nick_stats.default.tmpl Log Message: This should fix konqueror's halfway upside-down graphs Index: channel_stats.default.tmpl =================================================================== RCS file: /cvsroot/simbot/simbot/templates/channel_stats.default.tmpl,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -p -r1.2 -r1.3 --- channel_stats.default.tmpl 17 Aug 2005 12:29:08 -0000 1.2 +++ channel_stats.default.tmpl 18 Aug 2005 23:19:34 -0000 1.3 @@ -5,7 +5,7 @@ <tr valign="bottom"> <TMPL_LOOP NAME=hourloop> <td style="height: 10em;"> - <div class="hour<TMPL_VAR NAME=hour>" style="height: <TMPL_VAR NAME="percent">%; background-color: #DDD; border: thin solid black;"> </div></td> + <div class="hour<TMPL_VAR NAME=hour>" style="height: <TMPL_VAR NAME="percent">%; background-color: #DDD; border: thin solid black; overflow: hidden;"> </div></td> </TMPL_LOOP> </tr> <tr> Index: nick_stats.default.tmpl =================================================================== RCS file: /cvsroot/simbot/simbot/templates/nick_stats.default.tmpl,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -p -r1.2 -r1.3 --- nick_stats.default.tmpl 18 Aug 2005 18:38:52 -0000 1.2 +++ nick_stats.default.tmpl 18 Aug 2005 23:19:34 -0000 1.3 @@ -5,7 +5,7 @@ <tr valign="bottom"> <TMPL_LOOP NAME=hourloop> <td style="height: 10em;"> - <div class="hour<TMPL_VAR NAME=hour>" style="height: <TMPL_VAR NAME="percent">%; background-color: #DDD; border: thin solid black;"> </div></td> + <div class="hour<TMPL_VAR NAME=hour>" style="height: <TMPL_VAR NAME="percent">%; background-color: #DDD; border: thin solid black; overflow: hidden;"> </div></td> </TMPL_LOOP> </tr> <tr> @@ -26,7 +26,7 @@ <TMPL_IF NAME=action_count> <div class="linecount"><TMPL_VAR NAME=nick> has emoted <TMPL_VAR NAME=action_count> times, most recently:<br/> -⢠<TMPL_VAR NAME=nick> <TMPL_VAR NAME=action_content> +⢠<TMPL_VAR NAME=nick> <TMPL_VAR NAME=action_content> </div> </TMPL_IF> |
|
From: Pete P. <fou...@us...> - 2005-08-18 23:13:41
|
Update of /cvsroot/simbot/simbot/plugins In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11696/plugins Modified Files: sqlite-logger.pl Log Message: Activity by hour for nicks Index: sqlite-logger.pl =================================================================== RCS file: /cvsroot/simbot/simbot/plugins/sqlite-logger.pl,v retrieving revision 1.63 retrieving revision 1.64 diff -u -d -p -r1.63 -r1.64 --- sqlite-logger.pl 17 Aug 2005 16:53:23 -0000 1.63 +++ sqlite-logger.pl 18 Aug 2005 17:51:30 -0000 1.64 @@ -964,6 +964,58 @@ sub web_stats { if ( defined $query->{'nick_id'} ) { # doing stats for a nickname + + my $stats_template = &$get_template('nick_stats'); + + my $channel_id = ( + defined $query->{'channel_id'} + ? $query->{'channel_id'} + : &get_nickchan_id( &SimBot::option( 'network', 'channel' ) ) + ); + + + my $nick_id = $query->{'nick_id'}; + + # Get the numbers for the graph at the top + my $hour_counts_query = + $dbh->prepare_cached( 'SELECT hour, count FROM nick_hour_counts' + . ' WHERE channel_id = ? AND nick_id = ? ORDER BY count DESC' + ); + + $hour_counts_query->execute($channel_id, $nick_id); + + my @hour_list; + my $max_hour; + + while ( my ( $hour, $count ) = $hour_counts_query->fetchrow_array ) { + my %hash; + + # The busiest hour will be the first one we get + if ( !defined $max_hour ) { $max_hour = $count; } + + $hash{'hour'} = $hour; + $hash{'percent'} = ( $count / $max_hour ) * 100; + + push( @hour_list, \%hash ); + } + @hour_list = sort { $a->{'hour'} <=> $b->{'hour'} } @hour_list; + + $stats_template->param( + hourloop => \@hour_list, + nick => &get_nickchan_name($nick_id), + timezone => 'UTC', + ); + + my $base_template = &$get_template('base'); + $base_template->param( + content => $stats_template->output(), + title => 'Statistics for ' . &get_nickchan_name($nick_id), + ); + + $response->content( $base_template->output() ); + $response->push_header( 'Content-Type', 'text/html' ); + return 200; + } else { # doing channel stats... my $stats_template = &$get_template('channel_stats'); |
|
From: Pete P. <fou...@us...> - 2005-08-18 23:10:48
|
Update of /cvsroot/simbot/simbot/plugins In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27628/plugins Modified Files: sqlite-logger.pl Log Message: Initialize the hours array with zeros Index: sqlite-logger.pl =================================================================== RCS file: /cvsroot/simbot/simbot/plugins/sqlite-logger.pl,v retrieving revision 1.66 retrieving revision 1.67 diff -u -d -p -r1.66 -r1.67 --- sqlite-logger.pl 18 Aug 2005 18:56:08 -0000 1.66 +++ sqlite-logger.pl 18 Aug 2005 23:10:09 -0000 1.67 @@ -988,6 +988,10 @@ sub web_stats { my @hour_list; my $max_hour; + + for(my $x=0; $x <= 23; $x++) { + $hour_list[$x] = { hour => $x, percent => 0 }; + } while ( my ( $hour, $count ) = $hour_counts_query->fetchrow_array ) { my %hash; @@ -998,9 +1002,8 @@ sub web_stats { $hash{'hour'} = $hour; $hash{'percent'} = ( $count / $max_hour ) * 100; - push( @hour_list, \%hash ); + $hour_list[$hour] = \%hash; } - @hour_list = sort { $a->{'hour'} <=> $b->{'hour'} } @hour_list; # Now, figure out some odd stats... @@ -1159,6 +1162,10 @@ sub web_stats { my @hour_list; my $max_hour; + + for(my $x=0; $x <= 23; $x++) { + $hour_list[$x] = { hour => $x, percent => 0 }; + } while ( my ( $hour, $count ) = $hour_counts_query->fetchrow_array ) { my %hash; @@ -1169,9 +1176,8 @@ sub web_stats { $hash{'hour'} = $hour; $hash{'percent'} = ( $count / $max_hour ) * 100; - push( @hour_list, \%hash ); + $hour_list[$hour] = \%hash; } - @hour_list = sort { $a->{'hour'} <=> $b->{'hour'} } @hour_list; my $nick_stats_query = $dbh->prepare_cached( |
|
From: Pete P. <fou...@us...> - 2005-08-18 18:56:15
|
Update of /cvsroot/simbot/simbot/tools In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28109/tools Modified Files: rebuild_irc_stats.pl Log Message: Only consider SAY and ACTION events for making the statistics graphs and the channel nick list. This should reduce the number of uninteresting stats entries. Index: rebuild_irc_stats.pl =================================================================== RCS file: /cvsroot/simbot/simbot/tools/rebuild_irc_stats.pl,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -p -r1.2 -r1.3 --- rebuild_irc_stats.pl 17 Aug 2005 13:01:54 -0000 1.2 +++ rebuild_irc_stats.pl 18 Aug 2005 18:56:08 -0000 1.3 @@ -40,7 +40,7 @@ print 'Resetting the nickname stats tabl local $dbh->{RaiseError}; # let's not die in this block local $dbh->{PrintError}; # and let's be quiet - $dbh->do('DROP TABLE nickstats'); + $dbh->do('DROP TABLE nick_hour_counts'); $dbh->do(<<EOT); CREATE TABLE nick_hour_counts ( @@ -56,7 +56,7 @@ print " Done.\n"; # Now we loop through every line in the log. -my $query = $dbh->prepare('SELECT time, channel_id, source_nick_id FROM chatlog'); +my $query = $dbh->prepare('SELECT time, channel_id, source_nick_id, event FROM chatlog'); my $update_query = $dbh->prepare( 'UPDATE nick_hour_counts' . ' SET count = count + 1' @@ -73,16 +73,19 @@ $query->execute(); print "Calculating users' hourly line counts"; my $row_number = 0; -while(my ($time, $channel_id, $nick_id) = $query->fetchrow_array) { +while(my ($time, $channel_id, $nick_id, $event) = $query->fetchrow_array) { my $hour = (gmtime($time))[2]; - unless(int $update_query->execute($nick_id, $channel_id, $hour)) { - $insert_query->execute($nick_id, $channel_id, $hour); - } - if(++$row_number % 800 == 0) { print '.'; } + + if($event =~ m/SAY|ACTION/) { + unless(int $update_query->execute($nick_id, $channel_id, $hour)) { + $insert_query->execute($nick_id, $channel_id, $hour); + } + } + } print " Done\nCommitting..."; |
|
From: Pete P. <fou...@us...> - 2005-08-18 18:56:15
|
Update of /cvsroot/simbot/simbot/plugins In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28109/plugins Modified Files: sqlite-logger.pl Log Message: Only consider SAY and ACTION events for making the statistics graphs and the channel nick list. This should reduce the number of uninteresting stats entries. Index: sqlite-logger.pl =================================================================== RCS file: /cvsroot/simbot/simbot/plugins/sqlite-logger.pl,v retrieving revision 1.65 retrieving revision 1.66 diff -u -d -p -r1.65 -r1.66 --- sqlite-logger.pl 18 Aug 2005 18:38:51 -0000 1.65 +++ sqlite-logger.pl 18 Aug 2005 18:56:08 -0000 1.66 @@ -235,14 +235,16 @@ sub set_seen { my $hour = ( gmtime(time) )[2]; - unless ( - int $update_nick_hour_count_query->execute( - $source_nick_id, $channel_id, $hour - ) - ) - { - $insert_nick_hour_count_query->execute( $source_nick_id, $channel_id, - $hour ); + if($doing =~ m/SAY|ACTION/) { + unless ( + int $update_nick_hour_count_query->execute( + $source_nick_id, $channel_id, $hour + ) + ) + { + $insert_nick_hour_count_query->execute( $source_nick_id, $channel_id, + $hour ); + } } $dbh->commit; } ## end sub set_seen |
|
From: Pete P. <fou...@us...> - 2005-08-18 18:40:08
|
Update of /cvsroot/simbot/simbot/templates In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23634/templates Modified Files: nick_stats.default.tmpl Log Message: More stats Index: nick_stats.default.tmpl =================================================================== RCS file: /cvsroot/simbot/simbot/templates/nick_stats.default.tmpl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -p -r1.1 -r1.2 --- nick_stats.default.tmpl 18 Aug 2005 17:51:30 -0000 1.1 +++ nick_stats.default.tmpl 18 Aug 2005 18:38:52 -0000 1.2 @@ -15,4 +15,36 @@ <td>20</td><td>21</td><td>22</td><td>23</td> </tr> </table> + +<h4>Misc Statistics</h4> + +<TMPL_IF NAME=say_count> + <div class="linecount"><TMPL_VAR NAME=nick> has spoken <TMPL_VAR NAME=say_count> times, most recently saying:<br/> + <TMPL_VAR NAME=say_content> + </div> +</TMPL_IF> + +<TMPL_IF NAME=action_count> +<div class="linecount"><TMPL_VAR NAME=nick> has emoted <TMPL_VAR NAME=action_count> times, most recently:<br/> +⢠<TMPL_VAR NAME=nick> <TMPL_VAR NAME=action_content> +</div> +</TMPL_IF> + +<TMPL_IF NAME=topic_count> +<div class="linecount"><TMPL_VAR NAME=nick> has set the topic <TMPL_VAR NAME=topic_count> times, most recently changing it to:<br/> +<TMPL_VAR NAME=topic_content> +</div> +</TMPL_IF> + +<TMPL_IF NAME=kick_others_count> +<div class="linecount"><TMPL_VAR NAME=nick> has kicked others <TMPL_VAR NAME=kick_others_count> times, most recently kicking <TMPL_VAR NAME=kick_others_target> with the reason <q><TMPL_VAR NAME=kick_others_content></q> +</div> +</TMPL_IF> + + +<TMPL_IF NAME=kicked_count> +<div class="linecount"><TMPL_VAR NAME=nick> has been kicked <TMPL_VAR NAME=kicked_count> times, most recently by <TMPL_VAR NAME=kicked_by> with the reason <q><TMPL_VAR NAME=kicked_content></q> +</div> +</TMPL_IF> + <!-- End nick_stats --> \ No newline at end of file |
|
From: Pete P. <fou...@us...> - 2005-08-18 18:39:48
|
Update of /cvsroot/simbot/simbot/plugins In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23634/plugins Modified Files: sqlite-logger.pl Log Message: More stats Index: sqlite-logger.pl =================================================================== RCS file: /cvsroot/simbot/simbot/plugins/sqlite-logger.pl,v retrieving revision 1.64 retrieving revision 1.65 diff -u -d -p -r1.64 -r1.65 --- sqlite-logger.pl 18 Aug 2005 17:51:30 -0000 1.64 +++ sqlite-logger.pl 18 Aug 2005 18:38:51 -0000 1.65 @@ -1000,6 +1000,128 @@ sub web_stats { } @hour_list = sort { $a->{'hour'} <=> $b->{'hour'} } @hour_list; + + # Now, figure out some odd stats... + my $tmp_query = + $dbh->prepare_cached( 'SELECT time FROM chatlog' + . ' WHERE channel_id = ?' + . ' AND (source_nick_id = ?' + . ' OR target_nick_id = ?)' + . ' ORDER BY time' + . ' LIMIT 1' ); + $tmp_query->execute( $channel_id, $nick_id, $nick_id ); + $stats_template->param( + firstdate => localtime( ( $tmp_query->fetchrow_array() )[0] ), + ); + $tmp_query->finish; + + $tmp_query = + $dbh->prepare_cached( 'SELECT time FROM chatlog' + . ' WHERE channel_id = ?' + . ' AND (source_nick_id = ?' + . ' OR target_nick_id = ?)' + . ' ORDER BY time DESC' + . ' LIMIT 1' ); + $tmp_query->execute( $channel_id, $nick_id, $nick_id ); + $stats_template->param( + lastdate => localtime( ( $tmp_query->fetchrow_array() )[0] ), + ); + $tmp_query->finish; + + my $target_query = + $dbh->prepare_cached( 'SELECT count() FROM chatlog' + . ' WHERE channel_id = ?' + . ' AND target_nick_id = ?' + . ' AND event = ?' ); + my $source_query = + $dbh->prepare_cached( 'SELECT count() FROM chatlog' + . ' WHERE channel_id = ?' + . ' AND source_nick_id = ?' + . ' AND event = ?' ); + + my $content_source_query = $dbh->prepare_cached( 'SELECT source_nick_id, target_nick_id, content FROM chatlog' + . ' WHERE channel_id = ?' + . ' AND source_nick_id = ?' + . ' AND event = ?' + . ' ORDER BY time DESC' + . ' LIMIT 1'); + + my $content_target_query = $dbh->prepare_cached( 'SELECT source_nick_id, target_nick_id, content FROM chatlog' + . ' WHERE channel_id = ?' + . ' AND target_nick_id = ?' + . ' AND event = ?' + . ' ORDER BY time DESC' + . ' LIMIT 1'); + + my $value; + + $source_query->execute( $channel_id, $nick_id, 'SAY' ); + $value = ( $source_query->fetchrow_array() )[0]; + if($value > 0) { + $content_source_query->execute( $channel_id, $nick_id, 'SAY'); + my $content = ( $content_source_query->fetchrow_array())[2]; + + $stats_template->param( + say_count => $value, + say_content => $content, + ); + } + + $source_query->execute( $channel_id, $nick_id, 'ACTION' ); + $value = ( $source_query->fetchrow_array() )[0]; + if($value > 0) { + $content_source_query->execute( $channel_id, $nick_id, 'ACTION'); + my $content = ( $content_source_query->fetchrow_array())[2]; + + $stats_template->param( + action_count => $value, + action_content => $content, + ); + } + + $source_query->execute( $channel_id, $nick_id, 'TOPIC' ); + $value = ( $source_query->fetchrow_array() )[0]; + if($value > 0) { + $content_source_query->execute( $channel_id, $nick_id, 'TOPIC'); + my $content = ( $content_source_query->fetchrow_array())[2]; + + $stats_template->param( + topic_count => $value, + topic_content => $content, + ); + } + + $source_query->execute( $channel_id, $nick_id, 'KICKED' ); + $value = ( $source_query->fetchrow_array() )[0]; + if($value > 0) { + $content_source_query->execute( $channel_id, $nick_id, 'KICKED'); + my (undef, $target_nick_id, $content) = $content_source_query->fetchrow_array(); + + $stats_template->param( + kick_others_count => $value, + kick_others_content => $content, + kick_others_target => &get_nickchan_name($target_nick_id), + ); + } + + $target_query->execute( $channel_id, $nick_id, 'KICKED' ); + $value = ( $target_query->fetchrow_array() )[0]; + if($value > 0) { + $content_target_query->execute( $channel_id, $nick_id, 'KICKED'); + my ($source_nick_id, undef, $content) = $content_target_query->fetchrow_array(); + + $stats_template->param( + kicked_count => $value, + kicked_content => $content, + kicked_by => &get_nickchan_name($source_nick_id), + ); + } + + $source_query->finish; $target_query->finish; + $content_source_query->finish; $content_target_query->finish; + + + $stats_template->param( hourloop => \@hour_list, nick => &get_nickchan_name($nick_id), @@ -1015,7 +1137,6 @@ sub web_stats { $response->content( $base_template->output() ); $response->push_header( 'Content-Type', 'text/html' ); return 200; - } else { # doing channel stats... my $stats_template = &$get_template('channel_stats'); |
|
From: Pete P. <fou...@us...> - 2005-08-18 18:39:47
|
Update of /cvsroot/simbot/simbot/templates/css In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23634/templates/css Modified Files: main.default.css Log Message: More stats Index: main.default.css =================================================================== RCS file: /cvsroot/simbot/simbot/templates/css/main.default.css,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -p -r1.2 -r1.3 --- main.default.css 11 Aug 2005 15:32:30 -0000 1.2 +++ main.default.css 18 Aug 2005 18:38:52 -0000 1.3 @@ -14,6 +14,12 @@ h1 { #content { margin: 1em 0; } +/* STATS STYLES */ +div.linecount { + padding: .1em 0; + margin: .5em 0; + background: #EEE; +} /* IRC LOG STYLES */ .ts { |
|
From: Pete P. <fou...@us...> - 2005-08-18 17:54:52
|
Update of /cvsroot/simbot/simbot/templates In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11696/templates Added Files: nick_stats.default.tmpl Log Message: Activity by hour for nicks --- NEW FILE: nick_stats.default.tmpl --- <!-- SimBot Default nick statistics template Copy to nick_stats.local.tmpl before editing --> <h4>Activity by Hour <TMPL_VAR NAME=timezone></h4> <table id="hourgraph"> <tr valign="bottom"> <TMPL_LOOP NAME=hourloop> <td style="height: 10em;"> <div class="hour<TMPL_VAR NAME=hour>" style="height: <TMPL_VAR NAME="percent">%; background-color: #DDD; border: thin solid black;"> </div></td> </TMPL_LOOP> </tr> <tr> <td>00</td><td>01</td><td>02</td><td>03</td><td>04</td><td>05</td><td>06</td> <td>07</td><td>08</td><td>09</td><td>10</td><td>11</td><td>12</td> <td>13</td><td>14</td><td>15</td><td>16</td><td>17</td><td>18</td><td>19</td> <td>20</td><td>21</td><td>22</td><td>23</td> </tr> </table> <!-- End nick_stats --> |
|
From: Pete P. <fou...@us...> - 2005-08-17 16:53:50
|
Update of /cvsroot/simbot/simbot/plugins In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv533/plugins Modified Files: sqlite-logger.pl Log Message: Better SQL queries, perltidy, and a comment or two. Index: sqlite-logger.pl =================================================================== RCS file: /cvsroot/simbot/simbot/plugins/sqlite-logger.pl,v retrieving revision 1.62 retrieving revision 1.63 diff -u -d -p -r1.62 -r1.63 --- sqlite-logger.pl 17 Aug 2005 12:33:54 -0000 1.62 +++ sqlite-logger.pl 17 Aug 2005 16:53:23 -0000 1.63 @@ -2,7 +2,7 @@ # SimBot sqlite Logger Plugin # # DESCRIPTION: -# Logs chat SimBot sees to a SQLite log. This could be used to +# Logs chat SimBot sees to a SQLite log. This could be used to # generate channel statistics, a more intelligent seen plugin, and # more. # @@ -12,12 +12,12 @@ # This program is free software; you can redistribute and/or modify it # under the terms of version 2 of the GNU General Public License as [...1837 lines suppressed...] + hash_plugin_nlp_verbs => [ 'seen', 'see' ], + hash_plugin_nlp_formats => + [ '{w} here', 'see {w}', '{w} seen', 'seen {w}' ], + hash_plugin_nlp_questions => [ 'have-you', 'did-you', 'when-is', ], ); - + $SimBot::hash_plugin_httpd_pages{'log'} = { - 'title' => 'Log Viewer', + 'title' => 'Log Viewer', 'handler' => \&web_request, }; $SimBot::hash_plugin_httpd_pages{'stats'} = { - 'title' => 'Statistics', + 'title' => 'Statistics', 'handler' => \&web_stats, -}; \ No newline at end of file +}; |
|
From: Kevin S. <ks...@us...> - 2005-08-17 13:02:04
|
Update of /cvsroot/simbot/simbot/tools In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8657/tools Modified Files: rebuild_irc_stats.pl Log Message: Is this nitpicky? Index: rebuild_irc_stats.pl =================================================================== RCS file: /cvsroot/simbot/simbot/tools/rebuild_irc_stats.pl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -p -r1.1 -r1.2 --- rebuild_irc_stats.pl 17 Aug 2005 01:50:24 -0000 1.1 +++ rebuild_irc_stats.pl 17 Aug 2005 13:01:54 -0000 1.2 @@ -70,7 +70,7 @@ my $insert_query = $dbh->prepare( . ' VALUES (?, ?, ?, 1)'); $query->execute(); -print "Calculating user's hourly line counts"; +print "Calculating users' hourly line counts"; my $row_number = 0; while(my ($time, $channel_id, $nick_id) = $query->fetchrow_array) { |
|
From: Pete P. <fou...@us...> - 2005-08-17 12:34:04
|
Update of /cvsroot/simbot/simbot/plugins In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3590/plugins Modified Files: sqlite-logger.pl Log Message: the nick list is now sorted. Index: sqlite-logger.pl =================================================================== RCS file: /cvsroot/simbot/simbot/plugins/sqlite-logger.pl,v retrieving revision 1.61 retrieving revision 1.62 diff -u -d -p -r1.61 -r1.62 --- sqlite-logger.pl 17 Aug 2005 12:29:08 -0000 1.61 +++ sqlite-logger.pl 17 Aug 2005 12:33:54 -0000 1.62 @@ -990,13 +990,14 @@ sub web_stats { } my @nick_list; - foreach my $cur_key (sort keys %nick_counts) { + foreach my $cur_key (keys %nick_counts) { my %hash; $hash{'link'} = "/stats?nick_id=${cur_key}"; $hash{'nick'} = &get_nickchan_name($cur_key); $hash{'line_count'} = $nick_counts{$cur_key}; push(@nick_list, \%hash); } + @nick_list = sort { lc $a->{'nick'} cmp lc $b->{'nick'} } @nick_list; my @hour_list; for (my $x=0; $x <= 23; $x++) { |
|
From: Pete P. <fou...@us...> - 2005-08-17 12:29:24
|
Update of /cvsroot/simbot/simbot/plugins In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2628/plugins Modified Files: sqlite-logger.pl Log Message: Show the channel name in the stats page title, and the time zone for the graph. (Which is always UTC currently, but that will change) Index: sqlite-logger.pl =================================================================== RCS file: /cvsroot/simbot/simbot/plugins/sqlite-logger.pl,v retrieving revision 1.60 retrieving revision 1.61 diff -u -d -p -r1.60 -r1.61 --- sqlite-logger.pl 17 Aug 2005 01:49:18 -0000 1.60 +++ sqlite-logger.pl 17 Aug 2005 12:29:08 -0000 1.61 @@ -990,7 +990,7 @@ sub web_stats { } my @nick_list; - foreach my $cur_key (keys %nick_counts) { + foreach my $cur_key (sort keys %nick_counts) { my %hash; $hash{'link'} = "/stats?nick_id=${cur_key}"; $hash{'nick'} = &get_nickchan_name($cur_key); @@ -1010,12 +1010,13 @@ sub web_stats { $stats_template->param(nickloop => \@nick_list, hourloop => \@hour_list, channel => &get_nickchan_name($channel_id), + timezone => 'UTC', ); my $base_template = &$get_template('base'); $base_template->param( content => $stats_template->output(), - title => 'Channel Statistics', + title => &get_nickchan_name($channel_id) . ' Statistics', ); $response->content($base_template->output()); |