All pastes #82083 Raw Edit

Miscellany

public text v1 · immutable
·published 2006-07-08 02:26 UTC
rendered paste body
on *:TEXT:!forum:#: { 
  set %msgnick $nick
  if $sock(Techefx) { /sockclose Techefx }   
  sockopen Techefx techefx.com 80
}
on *:sockopen:Techefx:{ 
  sockwrite -n $sockname GET /forums/ HTTP/1.1 
  sockwrite -n $sockname Host: techefx.com $+ $crlf $+ $crlf
}

on *:sockread:Techefx:{
  if ($sockerr) {
    notice $nick Socket Error
    halt
  }
  var %output
  sockread %output
  %output = $htmlfree(%output)
  echo -a %output
  if (*Our members have made a total of * posts* iswm %output) { set %posts %output }
}

on *:SOCKCLOSE:techefx: {
  notice %msgnick 12[ Board Statistics ] %posts %members %newmember
  unsetvars
}

alias unsetvars {
  unset %msgnick
  unset %posts
  unset %members
  unset %newmember
  unset %msg
}

alias htmlfree {
  var %x, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove(%x,&nbsp;)
  return %x
}