All pastes #99211 Raw Edit

Stuff

public text v1 · immutable
#99211 ·published 2006-07-25 04:03 UTC
rendered paste body
alias loc {
  /sockopen LocationScript dnsstuff.com 80
  set %nick $address($1,2)
  ;echo $address($1,2)
}
ON *:sockopen:LocationScript: {
  sockwrite -n $sockname Get /tools/ptr.ch?ip= $+ %nick
  sockwrite -n $sockname HOST: dnsstuff.com $+ $crlf $+ $crlf
}
On *:sockread:LocationScript: {   
  if ($sockerr) {
    echo -a Error.
    halt
  }
  else {
    var %temptext
    sockread %temptext
    if (</CENTER><PRE><A HREF="/info/geolocation.htm">Location</A>:* iswm %temptext) { 
      echo $htmlfree(%temptext)
      ;echo %temptext
    }
    else echo -a %temptext
  }
}
alias -l htmlfree {
  ; It's local because it won't be used by the command line, only this file.
  ; Local aliases avoid conflicting names.
  var %x, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove(%x,&nbsp;)
  return %x
}