All pastes #796841 Raw Edit

Anonymous

public text v1 · immutable
#796841 ·published 2007-11-25 14:16 UTC
rendered paste body
alias google {
  sockopen google www.google.com 80
  sockmark google echo -ta ¤ $1-
}
on *:sockopen:google:{
  sockwrite -tn google GET /search?hl=en&q= $+ $gettok($sock($sockname).mark,2,164) $+ &btnG=Search HTTP/1.0
  sockwrite -tn google Host: www.google.com
  sockwrite -tn google Accept-Language: nl,en-us;q=0.7,en;q=0.3
  sockwrite -tn google Accept-Encoding: gzip,deflate
  sockwrite -tn google Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
  sockwrite -tn google Keep-alive: 300
  sockwrite -tn google Connection: keep-alive
  sockwrite -tn google Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
  sockwrite -tn google $crlf
}
on *:sockread:google:{
  if ($sockerr) $gettok($sock($sockname).mark,1,164) Socket error in Google socket.
  else { 
    while ($sock(google).rq) {
      sockread &anal
      bwrite gay -1 -1 &anal
    }
    bread gay 0 $file(gay).size &sex 
    if ($bfind(&sex,$calc($file(gay).size - 50),</HTML>)) { 
      run notepad.exe gay
      sockclose google
    }
  }
}
alias -l htmlfree {
  var %x, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove(%x,&nbsp;)
return %x }