All pastes #985947 Raw Edit

Unnamed

public text v1 · immutable
·published 2008-04-15 12:52 UTC
rendered paste body
alias pulse {
  set %ticks $ticks
  set $+(%,prefix.,%ticks) msg $active
  if ($sock($+(wp.,%ticks))) { sockclose $+(wp.,%ticks) }
  sockopen $+(wp.,%ticks) whatpulse.org 80
  set %id granty
}

on *:SOCKOPEN:wp.*:{
  sockwrite -nt $sockname GET //stats/users/ $+ %id $+ /normal/ HTTP/1.1
  sockwrite -nt $sockname Host: whatpulse.org
  sockwrite -nt $sockname $crlf
}

on *:SOCKREAD:wp.*:{
  if ($sockerr) { echo -a $sockerr | halt }
  else {
    var %read
    sockread %read
    if (place.<br /> isin %read) { tokenize 32 %read | set %place $4 }
    if (participant isin %read) {
      tokenize 32 %read
      $($+(%,prefix.,$remove($sockname,wp.)),2) 14[04WhatPulse14]:[4 $+ %id $+ 14]Keys Hit:04 $17 14- 14Clicks:04 $20 14- Mouse:04 $29 14miles in $+(04,$remove($8,$chr(40))) $+ 14 $9 $+ .
    }
  }
}
on *:SOCKCLOSE:wp.*:{
  unset $+(%,erm.,$remove($sockname,wp.)) | unset $+(%,prefix.,$remove($sockname,wp.)) | unset %place | unset %ticks
}