All pastes #823988 Raw Edit

halo33 ;o

public text v1 · immutable
·published 2007-12-19 18:44 UTC
rendered paste body
alias halo3stats {
  if ($sock(halo3s)) { sockclose halo3s }
  sockopen halo3s www.the-beehive.net 80
  set %halo3 $1
}
on *:SOCKOPEN:halo3s: {
  sockwrite -nt $sockname GET /scripts/halo3-stats.php?= $+ [ %halo3 ] HTTP/1.1
  sockwrite -nt $sockname Host: www.the-beehive.net
  sockwrite -nt $sockname $crlf
}
on *:SOCKREAD:halo3s: {
  if ($sockerr) { echo -s Halo3 Error: $sockerr | halt }
  else {
    var %sockreader
    sockread -f %sockreader
    var %sockreader = $strip_headers(%sockreader,halo3s)
    echo -a %sockreader
  }
}
;ty lololz swiftirc forams?
alias strip_headers {
  if ($hget(headers,$2)) {
    return $1
  }
  if ($len($1) == 0) {
    /hadd -mz headers $2 4
  }
}