Jump to content

Archived

This topic is now archived and is closed to further replies.

chain

Google Search

Recommended Posts

  • Administrators
Description: Sockets that let users search google through you....

 

 

 

>alias googlesearch {  var %x = 1  while ($sock($+(google,%x))) inc %x  sockopen $+(google,%x) www.google.com 80  sockmark $+(google,%x) $1-}ON *:SOCKOPEN:google*: {  if ($sockerr) {    var %cmd = $gettok($sock($sockname).mark,1,32)    %cmd Socket error $sockerr    return  }  sockwrite -n $sockname GET $+(/search?q=,$phex($gettok($sock($sockname).mark,2-,32)),&btnI=I%27m+Feeling+Lucky HTTP/1.0)  sockwrite $sockname $crlf}on *:SOCKREAD:google*: {  var %f, %cmd, %result  %cmd = $gettok($sock($sockname).mark,1,32)  if ($sockerr) {    %cmd Socket error $sockerr    return  }  while (1) {    sockread %f    if (!$sockbr) break    if (here. iswm %f) {      %result = $gettok(%f,2,34)      sockclose $sockname      break    }    elseif (HTTP/1.0 200 OK = %f) {      %result = There are no results.      sockclose $sockname      break    }  }  if (%result) {    %cmd %result  }}alias google.responce { msg %google.responce 14[12G04o8o12g9l4e 09search15:10 $1- $+ 14] | unset %google3 }on *:TEXT:!google *:#: {  set %google.responce $chan  googlesearch google.responce $2-}

Link to comment
Share on other sites



×
×
  • Create New...