Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

No results..

0 views
Skip to first unread message

Nick

unread,
Apr 18, 2006, 6:15:06 AM4/18/06
to
Hello,

i make a bot tool to search on google but he give no results.. The
results are empty.
Who can help me.

the code:
---------------------------------------------------------------------------------------------------

use SOAP::Lite;
sub google
{
my ($bot, $self, $user, $msg) = @_;
$self->{settings}->{callback} = "google";
my $googlekey = 'MY GOOGLE KEY';
my $reply;
if ($msg eq '')
{
$self->{settings}->{doing} = "search";
$reply = "Please type in what you would like to search for. Remember,
you can stop at any time by saying 'stop'.";
}
elsif ($msg eq 'stop')
{
$self->{settings}->{callback} = '';
delete $self->{settings}->{doing};
$reply = "You have stopped searching Google.";
}
elsif ($self->{settings}->{doing} eq "search")
{
my $search = SOAP::Lite->service("
http://api.google.com/GoogleSearch.wsdl")->doGoogleSearch($googlekey,$msg,0,5,1,'','','UTF-8','UTF-8');
$reply = "Google Search Results:\n\n";
my $number = 0;
foreach my $result (@{$search->{resultElements}})
{
$number++;
$reply .= $number . ": " . $result->{title} . "\nURL: " .
$result->{URL};
}
$reply =~ s/\<b\>//ig;
$reply =~ s/\<\/b\>//ig;
}
else
{
$reply = "Incorrect Usage";
}
return $reply;
}
-------------------------------------------------------------------------------------------------------------------

0 new messages