require "socket"
require "delicious"

PORT = 4321
HOST = "phidget.server.host"
USER = "masui"

server = TCPSocket.open(HOST,PORT)
 
while true
 s = server.gets
 break if s.nil?
 a = s.split(/,/)
 if a[1] == 'Weight' then
  weight = a[2].to_f
  if weight > 4.0 then
   register(USER)
  end
 end
end