Here is it:
alias insult {
if $sock(insult) {
sockclose insult
}
sockopen insult www.randominsults.net 80
sockmark insult $iif($isid,.msg $iif(#,#,$nick),echo -a)
}
on *:sockopen:insult:{
sockwrite -n insult GET / HTTP/1.1
sockwrite -n insult Host: $sock(insult).addr
sockwrite -n insult
}
on *:sockread:insult:{
var %insultreader
sockread %insultreader
if $regex(%insultreader,/<i>(.+)<\/i>/) {
$sock(insult).mark Insult: 4 $+ $regml(1)
}
}
on *:text:$($iif(!insult == $strip($1),$1)):*:{
if (!%flood) {
inc -u4 %flood
$insult
}
}