mIRC Home    About    Download    Register    News    Help

Print Thread
Page 1 of 2 1 2
M
Majestic
Majestic
M
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

P
pheonix
pheonix
P
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

Last edited by pheonix; 07/07/03 12:18 PM.
Joined: May 2003
Posts: 215
L
Fjord artisan
Offline
Fjord artisan
L
Joined: May 2003
Posts: 215
Code:
on *:INPUT:*: {
  if ($1 == !google) { run $+(http://www.google.com.au/search?q=,$replace($2-,$chr(32),+)) }
}


usage: !google <search topic>

P
pheonix
pheonix
P
oops,did you want it to message the results to the channel or open the website search?

M
Majestic
Majestic
M
mh...this can not post the result.
what wrong do I make?
it is not a eggdrop, it is a normaly mIRC script.

P
pheonix
pheonix
P
in the on level:TEXT: bit change level to your user level

M
Majestic
Majestic
M
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-)
}

P
pheonix
pheonix
P
that should work.

M
Majestic
Majestic
M
the script post nothing to the channel! :-((

P
pheonix
pheonix
P
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.

Last edited by pheonix; 07/07/03 01:05 PM.
M
Majestic
Majestic
M
!google irc
or
!google irc networks

nothing say the script!
mh.... [censored]

P
pheonix
pheonix
P
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-)
}

M
Majestic
Majestic
M
!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

P
pheonix
pheonix
P
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

M
Majestic
Majestic
M
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?

P
pheonix
pheonix
P
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-)
}

Joined: Jan 2003
Posts: 2,973
K
Hoopy frood
Offline
Hoopy frood
K
Joined: Jan 2003
Posts: 2,973
does notice $nick actually work with it being outside of an event? By the time its executes, $nick woud return null i would think.

P
pheonix
pheonix
P
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-)
}

Q
Qwaka
Qwaka
Q
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.

M
Majestic
Majestic
M
yes, too!

no results or errors frown

Page 1 of 2 1 2

Link Copied to Clipboard