Takes a fact off the 4q.cc Vin Diesel Fact Generator and pastes it in the channel for all to see.
alias vinfact {
sockopen vin www.4q.cc 80
}
on *:SOCKOPEN:vin: {
if ($sockerr > 0) {
return
sockclose vin
%inuse = 0
echo -s Socket Error.
}
else {
sockwrite -n vin GET /vin/index.php HTTP/1.1
sockwrite -n vin Host: www.4q.cc $+ $str($crlf,2)
}
}
on *:SOCKREAD:vin: {
sockread %text
if (*<p class="fact">* iswm %text) {
%line = %text
%line = $replace(%line, <p class="fact">, $null, ", ", </p>, $null, <, <, >, >)
msg %chan Random Vin Diesel Fact: %line
sockclose vin
%inuse = 0
}
}
on *:TEXT:*:# {
if ($1- == !vin) {
if (%inuse == 0) {
%chan = $chan
vinfact
%inuse = 1
}
}
}