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.comThanx
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
on *:INPUT:*: {
if ($1 == !google) { run $+(http://www.google.com.au/search?q=,$replace($2-,$chr(32),+)) }
}
usage: !google <search topic>
oops,did you want it to message the results to the channel or open the website search?
mh...this can not post the result.
what wrong do I make?
it is not a eggdrop, it is a normaly mIRC script.
in the on level:TEXT: bit change level to your user level
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-)
}
the script post nothing 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
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.
!google irc
or
!google irc networks
nothing say the script!
mh.... [censored]
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-)
}
!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.
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
the script is good, but it post the result to all open chans!
how i can make that the script post the result as query message?
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-)
}
does notice $nick actually work with it being outside of an event? By the time its executes, $nick woud return null i would think.
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-)
}
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.
yes, too!
no results or errors
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-)
}
the post comes into the chan window.
but not as query.
but nearly it is finished
finished
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-)
}
now is the result as query msg
but it comes only 1 time and not again
that may be because of your flood settings.
also try changing msg %nick to query %nick
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, )
return %x
}
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