rendered paste bodyalias tfact {
sockopen tea www.4q.cc 80
}
on *:SOCKOPEN:tea: {
if ($sockerr > 0) {
return
sockclose tea
%inuse = 0
echo -s Socket Error.
}
else {
sockwrite -n tea GET /t/index.php HTTP/1.1
sockwrite -n tea Host: www.4q.cc $+ $str($crlf,2)
}
}
on *:SOCKREAD:tea: {
sockread %text
if (*<p class="fact">* iswm %text) {
%line = %text
%line = $replace(%line, <p class="fact">, $null, ", ", </p>, $null, <, <, >, >)
scid %cid msg %chan %line
sockclose tea
%inuse = 0
}
}
on *:TEXT:!T*:# {
if (%inuse == 0) {
%chan = $chan
%cid = $cid
tfact
%inuse = 1
}
}
on *:INPUT:# {
if (!t isin $1) && (%inuse == 0) {
%chan = $chan
%cid = $cid
tfact
%inuse = 1
}
}