another way of doing this code is a socket. This is only an example! I know that Weasel would have no clue how to make a socket but il post this as a comment anyways. So again this is only a example:
on $*:text:/@fortune$/iS:#: { if (!%fortuneflood) { set -u3 %fortuneflood on | if ($sock(fortune)) .sockclose fortune | set %fortune.chan.nick $chan $nick | .sockopen fortune www.fortunecookiemessage.com 80 } }
on *:sockopen:fortune: { sockwrite -nt $sockname GET / HTTP/1.1 | sockwrite -nt $sockname Host: www.fortunecookiemessage.com | sockwrite -nt $sockname $crlf }
on *:sockread:fortune: {
var %fortune | sockread %fortune
if ($regex(%fortune,/(\w.+)<\/p>/)) { msg $gettok(%fortune.chan.nick,1,32) 14[04 $gettok(%fortune.chan.nick,2,32) Here Is Your Random Fortune 14] $regml(1) | unset %fortune.chan.nick | .sockclose fortune }
}