All pastes #995113 Raw Edit

Someone

public text v1 · immutable
#995113 ·published 2008-04-23 21:33 UTC
rendered paste body
on *:input:#: { if ($1 == !1month*) {
    if ($sock(month2)) .sockclose month2
    set %chan $chan
    set %nick $nick
    sockopen month2 www.site.net 80
  }
  on *:SOCKOPEN:month2: {
    sockwrite -nt $sockname GET /apache2-default/vnstat/index.php?if=eth0&graph=large&page=s HTTP/1.1
    sockwrite -nt $sockname Host: www.site.net
    sockwrite -nt $sockname $crlf
  }
  on *:SOCKREAD:month2: {
    if ($sockerr) {
      msg %chan Socket Error: $sockname $+ . Error code: $sockerr Please inform $me of this error message.
      halt
    }
    else {
      var %sockreader
      sockread %sockreader
      if (*This month* iswm %sockreader ) {
        set %month2 $replace(%sockreader,<tr><td class="label_even">This month</td><td class="numeric_even">, , 

,</td><td class="numeric_even">,</td><td class="numeric_even">,...,</td></tr>, , ,)
        msg %chan Site Traffic This Month. In, Out, Total: %month2    
        unset %chan
        unset %nick
        sockclose month2
      }
    }
  }