Mercurial > ~darius > hgwebdir.cgi > scrape-gm
comparison 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 |
comparison
equal
deleted
inserted
replaced
10:0e18c714b69d | 11:22a51e8c0a69 |
---|---|
49 # $data = "nick/#channel :text" | 49 # $data = "nick/#channel :text" |
50 my ($server, $data, $nick, $address) = @_; | 50 my ($server, $data, $nick, $address) = @_; |
51 my ($target, $text) = split(/ :/, $data, 2); | 51 my ($target, $text) = split(/ :/, $data, 2); |
52 | 52 |
53 #print CLIENTCRAP "target = \"$target\""; | 53 #print CLIENTCRAP "target = \"$target\""; |
54 if (lc($target) ne "#teabf" && lc($target) ne "#tea") { | 54 if (lc($target) ne "#teabf" && lc($target) ne "#tea" && lc($target) ne "darius") { |
55 return; | 55 return; |
56 } | 56 } |
57 #print CLIENTCRAP "target = \"$target\""; | 57 #print CLIENTCRAP "target = \"$target\""; |
58 | 58 |
59 # Remove colours, bold etc (taken from cleanpublic.pl) | 59 # Remove colours, bold etc (taken from cleanpublic.pl) |
74 $string = "[TEA]"; | 74 $string = "[TEA]"; |
75 #print CLIENTCRAP "No target, using [TEA]"; | 75 #print CLIENTCRAP "No target, using [TEA]"; |
76 } | 76 } |
77 $server->command("msg $target Looking for \"$string\" on game-monitor.com..."); | 77 $server->command("msg $target Looking for \"$string\" on game-monitor.com..."); |
78 open (SCR, "-|", "/home/doconnor/bin/scrape-gm.py", $string); | 78 open (SCR, "-|", "/home/doconnor/bin/scrape-gm.py", $string); |
79 my $i = 0; | |
79 while (<SCR>) { | 80 while (<SCR>) { |
80 chomp; | 81 chomp; |
81 $server->command("msg $target $_"); | 82 $server->command("msg $target $_"); |
83 $i++; | |
84 if ($i > Irssi::settings_get_int('fp_maxlen')) { | |
85 $server->command("msg $target Too many results, truncating"); | |
82 } | 86 } |
83 close SCR; | 87 close SCR; |
84 } | 88 } |
85 } | 89 } |
86 | 90 |
87 Irssi::signal_add("event privmsg", "event_privmsg"); | 91 Irssi::signal_add("event privmsg", "event_privmsg"); |
88 Irssi::settings_add_int('misc', 'fp_mininter', 10); | 92 Irssi::settings_add_int('misc', 'fp_mininter', 10); |
93 Irssi::settings_add_int('misc', 'fp_maxlen', 10); | |
89 | 94 |
90 print CLIENTCRAP "findplayer loaded"; | 95 print CLIENTCRAP "findplayer loaded"; |
91 1; | 96 1; |
92 | 97 |
93 #;;; Local Variables: *** | 98 #;;; Local Variables: *** |