when Scakk commented on my snippets, i thought he was an expert
cause he commented many things about it
this is a edit for the socket part
where no need the on sockclose event, and will return the same thing
alias whoisip { sockopen IPwhois www.melissadata.com 80 | sockmark ipwhois $$1 }
on *:sockopen:IPwhois: {
var %x sockwrite -n $sockname
%x GET $+(/lookups/iplocation.asp?ipaddress=,$sock(ipwhois).mark) HTTP/1.1
%x Host: $sock(ipwhois).addr
%x Connection: close
%x Authorization: Basic
%x $crlf
}
on *:sockread:IPwhois: {
sockread %iptemp
if $regex(%iptemp,/<td class='columresult'>(.+)<\/td><td align='left'><b>(.+)<\/b><\/td><\/tr>/g) {
echo -a $timestamp $+([,$regml(1),],:) $remove($regml(2), ,$chr(9))
$iif($window(@whois), aline -p @whois $timestamp $+([,$regml(1),],:) $remove($regml(2), ,$chr(9)))
}
}