napa182 commented on a Page, RandomFunFacts.com Socket  -  Jun 15, 2009

it almost looks like you are useing some messed up socket maker to make these. =/

no need for all them vars an whatnot you could have just done this

on $*:text:/^@fact$/iS:#: {
  if ($sock(fact)) sockclose fact 
  sockopen fact www.randomfunfacts.com 80 
  sockmark fact msg # 
} 
on *:sockopen:fact: {
  sockwrite -nt $sockname GET / HTTP/1.1 
  sockwrite -nt $sockname Host: $+($sock(fact).addr,$str($crlf,2)) 
}
on *:sockread:fact: {
  var %fact | sockread %fact
  if ($regex(%fact,/<i>(.+)<\/i>/)) { 
    $sock(fact).mark $regml(1) 
    sockclose fact 
  }
}
 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.