lol @ the preview link
and using $sock($sockname).addr is not about the size of it. It's there to use so why not use it?
plus i never said to use it so w/e
But anyways Tinyurl asks that you do not scrape their site but w/e most people don't give a crap about what sites say... =/
if you want to fallow tinyurls rules heres a fast mock up using their API
alias turltest {
if ($sock(turl)) sockclose turl
sockopen turl tinyurl.com 80
sockmark turl $+(/api-create.php?url=,$$1)
}
on *:sockopen:turl:{
sockwrite -n turl GET $sock(turl).mark HTTP/1.1
sockwrite -n turl Host: $+($sock(turl).addr,$str($crlf,2))
}
on *:sockread:turl: {
var %turl | sockread %turl
if ($regex(%turl,/(http\S+)/)) {
echo -a $regml(1)
}
}