slacker commented on a Page, !fortune script  -  Oct 02, 2009

or maybe go with a socket for the hell of it

on $*:text:/@fortune$/iS:#: { if (!%fortuneflood) { set -u3 %fortuneflood on | 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-z].+)<\/p>/)) { msg $sock(fortune).mark $regml(1) :Lucky Numbers: $+($r(0,20),$chr(32),$r(10,50),$chr(32),$r(30,70),$chr(32),and,$chr(32),$r(50,99).) | .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.