I made this snippet for someone else here and decided it was good enough to add as a snippet. The syntax is /getalert CHANNEL|ECHO. Specifying a channel will cause it to send the alert level to that channel, specifying echo will cause it to echo the alert level to the active window.
--EDIT--
Updated per Xdaemon's request. Must have been a brain fluke that I had that in there in the first place.
alias getalert {
if ( #* !iswm $1 ) && ( $1 != echo ) {
echo $colour(info) -a * Invalid Channel Name
halt
}
if ( $me !ison $1 && $1 != echo ) {
echo $colour(info2) -a * $1 You are not on that channel, attempting to send message anyway...
}
sockopen tl www.defenselink.mil 80
sockmark tl $1
}
on *:SOCKOPEN:tl: {
if ( $sockerr ) {
echo $colour(info2) -a * Error in SockOpen. Error code $sockerr $+ ; aborting loookup.
sockclose tl
halt
}
sockwrite -n tl GET /index.html HTTP/1.0
sockwrite -n tl Host: www.defenselink.mil
sockwrite -n tl Connection: Keep-Alive
sockwrite tl $crlf
}
on *:SOCKREAD:tl: {
if ( $sockerr ) {
echo $colour(info2) -a * Error in SockRead. Error code $sockerr $+ ; aborting loookup.
sockclose tl
halt
}
sockread %tmp
tokenize 32 %tmp
if ( *IMG SRC*Banner*advisory* iswm $1- ) {
%tl = $remove($gettok($gettok($deltok($1-,1- $+ $calc($findtok($1-,$wildtok($1-,ALT="*,2,32),32) -1),32),2,34),8,32),:)
if ( $sock($sockname).mark == echo ) echo $colour(info) -a * Terror Alert Level: %tl
else msg $sock($sockname).mark Terror Alert Level: %tl
sockclose $sockname
}
}
@xdaemon, fixed
@supergeo, this can only be used on one channel at a time. The only way to use it for a flood would be with a timer, which you can already flood with. This would also be a much slower flood because it would have to keep opening and closing the socket, and sift through all the data. Much slower than just rapidly sending a single message or whatever.