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 }
}