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, )
return %x
}