; ; google.mrc ; ; ; Usage: type /google or have someone else type !google in a channel you're on. ; ; please dont complain if it doesnt work! google.com keep changing their website ; to either block people doing this or just to have fun... :) ; ; BTW, if you dont want people to be able to type !google in a channel to have you ; search for them uncomment the line below (just remove the semi-colon) and they will ; be blocked -- but it's protected against floods so it shouldnt be a problem for most ; people. ; ; ; UPDATE 2003-01-14: ; ; Using a new kind of code to find the result, something I hope wont break in the near future. ; ; ; -- ; Faile ; on *:text:!google *:#:{ ; UNCOMMENT THE LINE BELOW TO DISABLE THE "!google" COMMAND! HALT if (!$sock(google) && ((%google.flood == $null) || (%google.flood < 20))) { inc -z %google.flood 20 set %google.channel $chan google $2- } } alias google { if (!$1) { echo -a syntax: /google } else { if ($sock(google)) { sockclose google } set %google.query $1- sockopen google google.com 80 } } on *:sockopen:google:{ sockwrite -nt google GET /search?btnI=&q= $+ $replace(%google.query,$chr(32),% $+ 20) HTTP/1.0 sockwrite -n google } on *:sockread:google: { var %i sockread %i if ($gettok(%i,1,32) == Location:) { set %google.found 1 if (%google.channel) { msg %google.channel I'm feeling lucky: $gettok(%i,2,32) } else { echo -a [ google ] echo -a [ google ] I'm feeling lucky: $gettok(%i,2,32) echo -a [ google ] } } } on *:sockclose:google:{ if (!%google.found) { if (%google.channel) { msg %google.channel I'm Feeling Lucky: - } else { echo -a [ google ] echo -a [ google ] Sorry no results were found matching: %google.query $+ . echo -a [ google ] } } if (%google.channel) { unset %google.channel } unset %google.found }