1 2 3 4 5 6 7 8 9 10 11 12 13 14
require "rubygems" require "mqtt" IAM = ARGV.shift TO = ARGV.shift MQTT::Client.connect("server.flashinglightprize.nathan.uk0.bigv.io") do |c| c.get("ring/#{IAM}") do |topic, message| if message == IAM then sleep 0.1 c.publish("ring/#{TO}", TO) end end end