All pastes #38998 Raw Edit

Someone

public text v1 · immutable
#38998 ·published 2006-01-29 12:45 UTC
rendered paste body
alias 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, &quot;, ", </p>, $null, &lt;, <, &gt;, >)
    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
  }
}