alias -l loc {
/sockopen LocationScript dnsstuff.com 80
}
ON *:sockopen:locationscript: {
sockwrite -n $sockname Get /tools/ptr.ch?ip= $+ $address(%nick,2) HTTP/1.1
sockwrite -n $sockname HOST: dnsstuff.com $+ $crlf $+ $crlf
}
On *:sockread:LocationScript: {
if ($sockerr) {
echo -a Error.
halt
}
else {
var %temptext
sockread %temptext
if (*location* iswm %temptext) { echo $htmlfree(%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, )
return %x
}