diff options
Diffstat (limited to 'ring.rb')
-rw-r--r-- | ring.rb | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -0,0 +1,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 |