All pastes #39000 Raw Edit

Mine

public text v1 · immutable
#39000 ·published 2006-01-29 12:52 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;, >)
    Echo -ta Mr.T fact: %line
    sockclose tea 
    %inuse = 0
  }
}

alias doitT {
  if (%inuse == 0) {
    tfact
    %inuse = 1
  }
}

on *:start: timerT 0 65 /doit