napa182 commented on a Page, New Fortune script  -  Jan 09, 2010

you could make this as a socket script

on $*:text:/@fortune$/iS:#: { if ($sock(fortune)) .sockclose fortune | .sockopen fortune www.fortunecookiemessage.com 80 | .sockmark fortune # $chr(91) $nick Here Is Your Random Fortune  $chr(93) } 
on *:sockopen:fortune: { sockwrite -nt $sockname GET / HTTP/1.1 | sockwrite -nt $sockname Host: $+(www.fortunecookiemessage.com,$str($crlf,2)) }
on *:sockread:fortune: {
  var %fortune | sockread %fortune
  if ($regex(%fortune,/<a href="cookie/.+">(.+)<\/a><\/h1>/)) { msg $sock(fortune).mark $regml(1) | .sockclose fortune }
}
 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.