mIRC Home    About    Download    Register    News    Help

Print Thread
Page 2 of 2 1 2
Joined: May 2003
Posts: 2,265
P
Hoopy frood
Offline
Hoopy frood
P
Joined: May 2003
Posts: 2,265
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-)
}


new username: tidy_trax
Joined: Jul 2003
Posts: 21
M
Ameglian cow
OP Offline
Ameglian cow
M
Joined: Jul 2003
Posts: 21
the post comes into the chan window.
but not as query.

but nearly it is finished wink

Joined: Jul 2003
Posts: 21
M
Ameglian cow
OP Offline
Ameglian cow
M
Joined: Jul 2003
Posts: 21
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-)
}

Joined: Jul 2003
Posts: 21
M
Ameglian cow
OP Offline
Ameglian cow
M
Joined: Jul 2003
Posts: 21
now is the result as query msg
but it comes only 1 time and not again

Joined: May 2003
Posts: 2,265
P
Hoopy frood
Offline
Hoopy frood
P
Joined: May 2003
Posts: 2,265
that may be because of your flood settings.
also try changing msg %nick to query %nick


new username: tidy_trax
Joined: May 2003
Posts: 2,265
P
Hoopy frood
Offline
Hoopy frood
P
Joined: May 2003
Posts: 2,265
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
}


new username: tidy_trax
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
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


-KingTomato
Page 2 of 2 1 2

Link Copied to Clipboard