User Control Panel
Advertisements

HELP US, HELP YOU!

google search for andromeda bot

 
Post new topic   Reply to topic    Bot Depot Forum Index -> Commands
View unanswered posts
Author Message
patrick
Newbie
Newbie


Joined: 17 Apr 2006
Posts: 42
Location: Arnhem, the Netherlands
Reputation: 5.3Reputation: 5.3Reputation: 5.3Reputation: 5.3Reputation: 5.3
votes: 1

PostPosted: Sun May 07, 2006 6:24 pm    Post subject: google search for andromeda bot Reply with quote

This is my first command I made.
You need a google key (can be found here)
and you need http://api.google.com/GoogleSearch.wsdl (place it in your lib folder)

It is based on this made by Cer but this one is for the andromeda bot
Code:
sub google {
     my ($bot, $self, $user, $msg) = @_;

     # They need a search query.
     if (length $msg == 0) {
          return "You must provide a query to search for.\n\n"
               . "!google <search string>";
     }

     use SOAP::Lite;
     my $google = SOAP::Lite->service ('file:./lib/GoogleSearch.wsdl');
     my $query = $msg;
     my $result = $google->doGoogleSearch("YOUR GOOGLE KEY HERE", $query, 0, 5, 'false', '', 'false', '', 'latin1', 'latin1');

     my $reply;
     foreach my $element (@{$result->{resultElements}}) {
          $reply .= "$element->{title}\n"
               . "$element->{URL}\n\n";
     }
     return "Google Search Results\n\n" . $reply;
}

{
    Category    => 'Utilities',
    Usage       => 'google <query>',
    Description => 'Search with google.',
};
Back to top
darkmonkey
The Merovingian
The Merovingian


Joined: 18 Apr 2004
Posts: 2557
Location: London, England
Reputation: 39.3Reputation: 39.3Reputation: 39.3Reputation: 39.3
votes: 7

PostPosted: Sun May 07, 2006 6:33 pm    Post subject: Reply with quote

Well done; keep up the good work!
_________________
~ Josh
[ Need bot hosting on a dedicated server? PM me. ]
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Bot Depot Forum Index -> Commands All times are GMT
Page 1 of 1

 



Protected by phpBB Security phpBB-TweakS
phpBB Security Has Blocked 9 Exploit Attempts.
Antispam Captcha Mod by phpbb-security.com
Powered by phpBB © 2001, 2005 phpBB Group