napa182 commented on a Page, 2 in 1 - Tinyurl and !d (google define) sockets  -  Feb 09, 2011

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)
  }
}
 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.