User Control Panel
Advertisements

HELP US, HELP YOU!

Google search in morphius

 
Post new topic   Reply to topic    Bot Depot Forum Index -> Code Help
View unanswered posts
Author Message
prof3ta
Young One
Young One


Joined: 04 Mar 2004
Posts: 64

Reputation: 27.7Reputation: 27.7Reputation: 27.7

PostPosted: Mon Mar 08, 2004 6:33 pm    Post subject: Reply with quote

Does anyone know how to use google in morphius? Ive tried with these methods but i cant get it to work :S

http://www.bot-depot.com/forums/index.php?showtopic=834
http://www.bot-depot.com/forums/index.php?showtopic=1227

ANy ideas?
Back to top
mat007
Almost An Agent
Almost An Agent


Joined: 12 Jan 2004
Posts: 1375

Reputation: 15.8Reputation: 15.8
votes: 2

PostPosted: Mon Mar 08, 2004 7:10 pm    Post subject: Reply with quote

Code:
    if ($msg =~ /^google (.*)$/i) {<br />&send($self, "Searching for $1....","$username" );<br />$reply = google($1);<br />&send($self, "$reply");<br />goto end;<br />}<br /><br />sub google{<br />my $q = shift;<br />my $max = 10;<br />my $startat = 0;<br />my $restrict = '';<br />my $language = '';<br /><br /># Insert key below!<br />##########################<br />$googlekey = '..KEY...HERE!';<br />##########################<br /><br />my @hello = ($googlekey, $q, $startat, $max, 1, $restrict, 1, $language, 'UTF-8', 'UTF-8');<br /><br />my $bye =  SOAP::Lite -> service("http://api.google.com/GoogleSearch.wsdl") -> doGoogleSearch(@hello);<br /><br />$count = 0;<br /><br />$reply = "Results:\n";<br /><br />foreach $you (@{$bye->{resultElements}}){<br />$reply .= "\n".++$count.": ". $you->{title} . " - ". $you->{URL};<br />}<br /><br />if ($count == 0) {<br />$reply = "Sorry, nothing found.";<br />}<br /><br />$reply =~ s/\<b\>//ig;<br />$reply =~ s/\<\/b\>//ig;<br />return $reply;<br />}
Back to top
jeanhub
Almost An Agent
Almost An Agent


Joined: 14 Feb 2004
Posts: 1138

Reputation: 50.7

PostPosted: Mon Mar 08, 2004 10:22 pm    Post subject: Reply with quote

i dont know if this is an error...

Quote:
< ********@hotmail.com > - !google test
Subroutine google redefined at (eval 105) line 8.
Back to top
prof3ta
Young One
Young One


Joined: 04 Mar 2004
Posts: 64

Reputation: 27.7Reputation: 27.7Reputation: 27.7

PostPosted: Tue Mar 09, 2004 3:50 am    Post subject: Reply with quote

Thanks! that did it, just had to solve some issues with my perl in linux. You sure know your stuff....
Back to top
jeanhub
Almost An Agent
Almost An Agent


Joined: 14 Feb 2004
Posts: 1138

Reputation: 50.7

PostPosted: Tue Mar 09, 2004 10:22 pm    Post subject: Reply with quote

do we need to download a program to make it work?
Back to top
djwk
Young One
Young One


Joined: 09 Mar 2004
Posts: 86

Reputation: 28Reputation: 28Reputation: 28

PostPosted: Thu Mar 25, 2004 9:35 pm    Post subject: Reply with quote

no you dont need a program to make it work but *lazy* do need a license key
Back to top
Myzterio
Not Yet a God
Not Yet a God


Joined: 13 Dec 2003
Posts: 429

Reputation: 38.1Reputation: 38.1Reputation: 38.1Reputation: 38.1

PostPosted: Thu Mar 25, 2004 9:43 pm    Post subject: Reply with quote

or you can use this

Code:
if($msg =~ /^#google (.*)$/)<br />    {<br />         $self->sendmsg("http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=$1",Font => "Verdana",Effect => "B");<br />            $msg =~ s/ /\+/g;<br />    }
Back to top
Cer
Upgraded Agent
Upgraded Agent


Joined: 03 Feb 2004
Posts: 3776
Location: Michigan
Reputation: 146.9
votes: 4

PostPosted: Thu Mar 25, 2004 9:45 pm    Post subject: Reply with quote

QUOTE(Myzterio @ Mar 25 2004, 04:43 PM)
or you can use this

Code:
if($msg =~ /^#google (.*)$/)<br />    {<br />         $self->sendmsg("http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=$1",Font => "Verdana",Effect => "B");<br />            $msg =~ s/ /\+/g;<br />    }

That would convert spaces to + signs AFTER getting the URL.

Code:
if ($msg =~/^#google (.*)$/)<br />   {<br />      $1 =~ s/ /+/g;<br />      $self->Sendmsg ("http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=$1", Font => "Verdana", Effect => "B");<br />   }

_________________
Current Site (2008) http://www.cuvou.com/
Back to top
Myzterio
Not Yet a God
Not Yet a God


Joined: 13 Dec 2003
Posts: 429

Reputation: 38.1Reputation: 38.1Reputation: 38.1Reputation: 38.1

PostPosted: Thu Mar 25, 2004 10:03 pm    Post subject: Reply with quote

Right, i got an error
MS-Dos just goes away whenever i go #google
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Bot Depot Forum Index -> Code Help 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