Mercurial > ~darius > hgwebdir.cgi > scrape-gm
diff findplayer.pl @ 11:22a51e8c0a69
Update copyright date. Remove CVS ID.
author | darius@inchoate.localdomain |
---|---|
date | Fri, 29 Feb 2008 21:05:14 +1030 |
parents | 3ef64337d86b |
children |
line wrap: on
line diff
--- a/findplayer.pl Fri Feb 29 19:19:14 2008 +1030 +++ b/findplayer.pl Fri Feb 29 21:05:14 2008 +1030 @@ -51,7 +51,7 @@ my ($target, $text) = split(/ :/, $data, 2); #print CLIENTCRAP "target = \"$target\""; - if (lc($target) ne "#teabf" && lc($target) ne "#tea") { + if (lc($target) ne "#teabf" && lc($target) ne "#tea" && lc($target) ne "darius") { return; } #print CLIENTCRAP "target = \"$target\""; @@ -76,9 +76,13 @@ } $server->command("msg $target Looking for \"$string\" on game-monitor.com..."); open (SCR, "-|", "/home/doconnor/bin/scrape-gm.py", $string); + my $i = 0; while (<SCR>) { chomp; $server->command("msg $target $_"); + $i++; + if ($i > Irssi::settings_get_int('fp_maxlen')) { + $server->command("msg $target Too many results, truncating"); } close SCR; } @@ -86,6 +90,7 @@ Irssi::signal_add("event privmsg", "event_privmsg"); Irssi::settings_add_int('misc', 'fp_mininter', 10); +Irssi::settings_add_int('misc', 'fp_maxlen', 10); print CLIENTCRAP "findplayer loaded"; 1;