napa182 commented on a Page, Random pun  -  Jun 15, 2009

you can just do somthing like this

on $*:text:/^@pun$/iS:#: {
  if (!%f) { 
    inc -u3 %f 
    if ($sock(pun)) sockclose pun 
    sockopen pun www.punoftheday.com 80 
    sockmark pun msg # 
  } 
}
on *:sockopen:pun: {
  sockwrite -nt $sockname GET /cgi-bin/randompun.pl HTTP/1.1 
  sockwrite -nt $sockname Host: $+($sock(pun).addr,$str($crlf,2)) 
}
on *:sockread:pun: {
  var %pun | sockread %pun
  if ($regex(%pun,/<p>(.+)<\/p>/)) { 
    $sock(pun).mark $regml(1) 
    sockclose pun 
  }
}
 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.