mIRC Homepage
Posted By: Majestic Google search script for my mIRC? - 07/07/03 12:06 PM
hi, can anywhone post a script for my mIRC to search
with google? Example:

!google irc

And the answer of my script: Google search: www.irc.com

Thanx
Posted By: pheonix Re: Google search script for my mIRC? - 07/07/03 12:17 PM
alias google.search {
var %search $replace($1-,$chr(32),+)
sockopen google google.com 80
sockmark google /search?hl=en&ie=UTF-8&oe=UTF-8&q= $+ %search
}
on 1:SOCKOPEN:GOOGLE:{
sockwrite -n $sockname GET $sock($sockname).mark HTTP/1.1
sockwrite -n $sockname Accept: */*
sockwrite -n $sockname $crlf
}
on 1:SOCKREAD:GOOGLE:{
if ($sockerr > 0) { return }
sockread %s
if (*www* iswm %s) && (*google* !iswm %s) {
%type $remove($wildtok(%s,*www*,1,32),href=",</a>,<font,font>,<font>,<pre>,<body>)
}
on level:TEXT:!google*:#:{
.set %type amsg
$google.search($2-)
}
change level to your user level
Posted By: lammkott Re: Google search script for my mIRC? - 07/07/03 12:19 PM
Code:
on *:INPUT:*: {
  if ($1 == !google) { run $+(http://www.google.com.au/search?q=,$replace($2-,$chr(32),+)) }
}


usage: !google <search topic>
Posted By: pheonix Re: Google search script for my mIRC? - 07/07/03 12:23 PM
oops,did you want it to message the results to the channel or open the website search?
Posted By: Majestic Re: Google search script for my mIRC? - 07/07/03 12:31 PM
mh...this can not post the result.
what wrong do I make?
it is not a eggdrop, it is a normaly mIRC script.
Posted By: pheonix Re: Google search script for my mIRC? - 07/07/03 12:33 PM
in the on level:TEXT: bit change level to your user level
Posted By: Majestic Re: Google search script for my mIRC? - 07/07/03 12:42 PM
is this not wright for all users?
and i will poste the result directly to the channel!

----

alias google.search {
var %search $replace($1-,$chr(32),+)
sockopen google google.com 80
sockmark google /search?hl=en&ie=UTF-8&oe=UTF-8&q= $+ %search
}
on 1:SOCKOPEN:GOOGLE:{
sockwrite -n $sockname GET $sock($sockname).mark HTTP/1.1
sockwrite -n $sockname Accept: */*
sockwrite -n $sockname $crlf
}
on 1:SOCKREAD:GOOGLE:{
if ($sockerr > 0) { return }
sockread %s
if (*www* iswm %s) && (*google* !iswm %s) {
%type $remove($wildtok(%s,*www*,1,32),href=",</a>,<font,font>,<font>,<pre>,<body>)
}
on *:TEXT:!google*:#:{
.set %type amsg
$google.search($2-)
}
Posted By: pheonix Re: Google search script for my mIRC? - 07/07/03 12:44 PM
that should work.
Posted By: Majestic Re: Google search script for my mIRC? - 07/07/03 12:47 PM
the script post nothing to the channel! :-((
Posted By: pheonix Re: Google search script for my mIRC? - 07/07/03 12:49 PM
alias google.search {
var %search $replace($1-,$chr(32),+)
sockopen google google.com 80
sockmark google /search?hl=en&ie=UTF-8&oe=UTF-8&q= $+ %search
}
on 1:SOCKOPEN:GOOGLE:{
sockwrite -n $sockname GET $sock($sockname).mark HTTP/1.1
sockwrite -n $sockname Accept: */*
sockwrite -n $sockname $crlf
}
on 1:SOCKREAD:GOOGLE:{
if ($sockerr > 0) { return }
sockread %s
amsg $remove($wildtok(%s,*www*,1-,32),href=",</a>,<font,font>,<font>,<pre>,<body>)
}
on *:TEXT:!google*:#:{
$google.search($2-)
}

tell them to try searching for just 1 word,and if that works, then try 2 or more.
Posted By: Majestic Re: Google search script for my mIRC? - 07/07/03 12:58 PM
!google irc
or
!google irc networks

nothing say the script!
mh.... [censored]
Posted By: pheonix Re: Google search script for my mIRC? - 07/07/03 01:06 PM
alias google.search {
var %search $replace($1-,$chr(32),+)
sockopen google google.com 80
sockmark google /search?hl=en&ie=UTF-8&oe=UTF-8&q= $+ %search
}
on 1:SOCKOPEN:GOOGLE:{
sockwrite -n $sockname GET $sock($sockname).mark HTTP/1.1
sockwrite -n $sockname Accept: */*
sockwrite -n $sockname $crlf
}
on 1:SOCKREAD:GOOGLE:{
if ($sockerr > 0) { return }
sockread %s
amsg $remove($wildtok(%s,*www*,1-,32),href=",</a>,<font,font>,<font>,<pre>,<body>)
}
on *:TEXT:!google*:#:{
$google.search($2-)
}
Posted By: Majestic Re: Google search script for my mIRC? - 07/07/03 02:18 PM
!google flashfxp

[ +[script] ] href=http://www.google.com/webhp?hl=en><img
[ +[script] ] href=http://www.google.com/search?q=flashfxp&hl=en&lr=&ie=UTF-8&oe=UTF-8&cat=gwd/Top&sa=N&tab=wd
[ +[script] ] href=http://www.flashfxp.com/>.
[ +[script] ] color=#008000>www.tucows.com/preview/195152.html
.....

wow! i will only the best result. wink
Posted By: pheonix Re: Google search script for my mIRC? - 07/07/03 02:29 PM
alias google.search {
var %search $replace($1-,$chr(32),+)
sockopen google google.com 80
sockmark google /search?hl=en&ie=UTF-8&oe=UTF-8&q= $+ %search
}
on 1:SOCKOPEN:GOOGLE:{
sockwrite -n $sockname GET $sock($sockname).mark HTTP/1.1
sockwrite -n $sockname Accept: */*
sockwrite -n $sockname $crlf
}
on 1:SOCKREAD:GOOGLE:{
if ($sockerr > 0) { return }
sockread %s
if (*www* iswm %s) && (*google* !iswm %s) {
amsg $remove($wildtok(%s,*www*,1-,32),href=",</a>,<font,font>,<font>,<pre>,<body>,href=,color=#008000>,<,>)
}
}
on *:TEXT:!google*:#:{
$google.search($2-)
}


that should remove bit more of the html smile
Posted By: Majestic Re: Google search script for my mIRC? - 07/07/03 03:05 PM
the script is good, but it post the result to all open chans! frown
how i can make that the script post the result as query message?
Posted By: pheonix Re: Google search script for my mIRC? - 07/07/03 03:08 PM
alias google.search {
var %search $replace($1-,$chr(32),+)
sockopen google google.com 80
sockmark google /search?hl=en&ie=UTF-8&oe=UTF-8&q= $+ %search
}
on 1:SOCKOPEN:GOOGLE:{
sockwrite -n $sockname GET $sock($sockname).mark HTTP/1.1
sockwrite -n $sockname Accept: */*
sockwrite -n $sockname $crlf
}
on 1:SOCKREAD:GOOGLE:{
if ($sockerr > 0) { return }
sockread %s
if (*www* iswm %s) && (*google* !iswm %s) {
notice $nick $remove($wildtok(%s,*www*,1-,32),href=",</a>,<font,font>,<font>,<pre>,<body>,href=,color=#008000>,<,>)
}
}
on *:TEXT:!google*:#:{
$google.search($2-)
}
Posted By: KingTomato Re: Google search script for my mIRC? - 07/07/03 05:24 PM
does notice $nick actually work with it being outside of an event? By the time its executes, $nick woud return null i would think.
Posted By: pheonix Re: Google search script for my mIRC? - 07/07/03 05:45 PM
alias google.search {
var %search $replace($1-,$chr(32),+)
sockopen google google.com 80
sockmark google /search?hl=en&ie=UTF-8&oe=UTF-8&q= $+ %search
}
on 1:SOCKOPEN:GOOGLE:{
sockwrite -n $sockname GET $sock($sockname).mark HTTP/1.1
sockwrite -n $sockname Accept: */*
sockwrite -n $sockname $crlf
}
on 1:SOCKREAD:GOOGLE:{
if ($sockerr > 0) { return }
sockread %s
if (*www* iswm %s) && (*google* !iswm %s) {
notice %nick $remove($wildtok(%s,*www*,1-,32),href=",</a>,<font,font>,<font>,<pre>,<body>,href=,color=#008000>,<,>)
}
}
on *:TEXT:!google*:#:{
.set %nick $nick
$google.search($2-)
}
Posted By: Qwaka Re: Google search script for my mIRC? - 07/07/03 06:38 PM
I put this into my aliases and I get an error: (ERROR) Unknown command: TESTER
(Tester is my nick on IRC)

When I put it in my remotes, I get nothing. no results no errors. just nothing happens. I'm not implemeting this correctly ? any tips ? Thanks.
Posted By: Majestic Re: Google search script for my mIRC? - 07/07/03 06:48 PM
yes, too!

no results or errors frown
Posted By: pheonix Re: Google search script for my mIRC? - 07/07/03 06:52 PM
alias google.search {
var %search $replace($1-,$chr(32),+)
sockopen google google.com 80
sockmark google /search?hl=en&ie=UTF-8&oe=UTF-8&q= $+ %search
}
on 1:SOCKOPEN:GOOGLE:{
sockwrite -n $sockname GET $sock($sockname).mark HTTP/1.1
sockwrite -n $sockname Accept: */*
sockwrite -n $sockname $crlf
}
on 1:SOCKREAD:GOOGLE:{
if ($sockerr > 0) { return }
sockread %s
if (*www* iswm %s) {
notice %nick $remove($wildtok(%s,*www*,1-,32),href=",</a>,<font,font>,<font>,<pre>,<body>,href=,color=#008000>,<,>)
}
}
on *:TEXT:!google*:#:{
.set %nick $nick
$google.search($2-)
}
Posted By: Majestic Re: Google search script for my mIRC? - 07/07/03 06:58 PM
the post comes into the chan window.
but not as query.

but nearly it is finished wink
Posted By: Majestic Re: Google search script for my mIRC? - 07/07/03 07:00 PM
finished smile i hope!


alias google.search {
var %search $replace($1-,$chr(32),+)
sockopen google google.com 80
sockmark google /search?hl=en&ie=UTF-8&oe=UTF-8&q= $+ %search
}
on 1:SOCKOPEN:GOOGLE:{
sockwrite -n $sockname GET $sock($sockname).mark HTTP/1.1
sockwrite -n $sockname Accept: */*
sockwrite -n $sockname $crlf
}
on 1:SOCKREAD:GOOGLE:{
if ($sockerr > 0) { return }
sockread %s
if (*www* iswm %s) {
msg %nick $remove($wildtok(%s,*www*,1-,32),href=",</a>,<font,font>,<font>,<pre>,<body>,href=,color=#008000>,<,>)
}
}
on *:TEXT:!google*:#:{
.set %nick $nick
$google.search($2-)
}
Posted By: Majestic Re: Google search script for my mIRC? - 07/07/03 07:06 PM
now is the result as query msg
but it comes only 1 time and not again
Posted By: pheonix Re: Google search script for my mIRC? - 07/07/03 07:14 PM
that may be because of your flood settings.
also try changing msg %nick to query %nick
Posted By: pheonix Re: Google search script for my mIRC? - 09/07/03 02:15 PM
this removes all html that ive tried so far.

on *:TEXT:!google*:#:{
$google($2-)
.set %chan $chan
}
alias google {
set %search $replace($1-,$chr(32),+)
sockopen google google.com 80
sockmark google /search?hl=en&ie=UTF-8&oe=UTF-8&q= $+ %search
}
on *:SOCKOPEN:GOOGLE:{
sockwrite -n $sockname GET $sock($sockname).mark
sockwrite -n $sockname Accept: */*
sockwrite -n $sockname $crlf
}
on *:SOCKREAD:GOOGLE:{
if ($sockerr > 0) { return }
sockread %s
if (*www* iswm %s) && (*google* !iswm %s) && ($left($remove($htmlfree($wildtok(%s,*www*,1,32)),href=),3) == htt) || ($left($remove($htmlfree($wildtok(%s,*www*,1,32)),href=),3) == www) {
msg %chan $remove($htmlfree($wildtok(%s,*www*,1,32)),href=)
}
}
alias -l htmlfree {
var %x, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove(%x,&nbsp;)
return %x
}
Posted By: KingTomato Re: Google search script for my mIRC? - 09/07/03 06:02 PM
ur doing that the hard way... Every responce by google begins with "<p class=g>" If you were smart, u'd use a binvar and $bfind >:D
© mIRC Discussion Forums