Sephiroth
http://sephiroth.scifi-action.de/board/

Google
http://sephiroth.scifi-action.de/board/viewtopic.php?f=4&t=53
Seite 1 von 1

Autor:  Sephiroth [ 18. März 2008 14:07 ]
Betreff des Beitrags:  Google

;; GOOGLE! /google.go <channel> <search string>

alias google {
  sockclose google
  sockopen google google.com 80
  %google.temp = $1-
}
on 1:sockopen:google:{
  if ($sockerr > 0) return
  sockwrite -n google $eval(GET http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=,0) $+ $replace(%google.temp,$chr(32),+) $+ $eval(&btnI=I%27m+Feeling+Lucky HTTP/1.0,0)
  sockwrite -n google
}
on 1:sockread:google:{
  if ($sockerr > 0) return
  :nextread
  sockread %google.temp
  if ($sockbr == 0) return
  if (Location: isin %google.temp) {
    if (%google.chan) { msg %google.chan Google says:  $+ $right(%google.temp,-10) $+  }
    sockclose google | return
  }
  elseif (did not match any documents isin %google.temp) {
    if (%google.chan) { msg %google.chan Google says: nothing... no matches found }
    sockclose google | return
  }
  goto nextread
}
on 1:sockclose:google:{
  unset %google.*
}
alias google.go {
  set -u300 %google.activ $true
  set %google.chan $1
  google $2-
}

Seite 1 von 1 Alle Zeiten sind UTC + 1 Stunde
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/