[SimBot-commits] CVS: simbot/plugins google.pl,1.18,1.19
Status: Abandoned
Brought to you by:
kstange
|
From: Kevin S. <ks...@us...> - 2005-05-12 12:32:27
|
Update of /cvsroot/simbot/simbot/plugins In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17598/plugins Modified Files: google.pl Log Message: Fixed the define: queries again, and added a little code to eat any possible extra "term is" from the beginning of the result. Index: google.pl =================================================================== RCS file: /cvsroot/simbot/simbot/plugins/google.pl,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -p -r1.18 -r1.19 --- google.pl 4 May 2005 20:39:05 -0000 1.18 +++ google.pl 12 May 2005 12:32:18 -0000 1.19 @@ -65,8 +65,8 @@ sub google_find { &SimBot::send_message($channel, "$nick: $result"); } elsif ($response->content =~ m|Definitions of <b>(.*?)</b> on the Web:|) { my $term = $1; - if ($response->content =~ m/<li>(.*?)(<br>|<li>)/) { - my $result = $1; + if ($response->content =~ m/<li>($term is )?(.*?)\n?(<br>|<li>)/i) { + my $result = $2; $result =~ s|[\n\r]||g; $result = HTML::Entities::decode($result); &SimBot::send_pieces($channel, "$nick: ", "\"$term\" is $result"); |