diff options
author | Nat Lasseter <Redacted> | 2017-07-27 16:44:56 +0100 |
---|---|---|
committer | Nat Lasseter <Redacted> | 2017-07-27 16:44:56 +0100 |
commit | f7993b536d01957e5e9cfc91af01617d7e48704c (patch) | |
tree | 4df98738c1d7ac687f2deb29cbc9c7a6bb6fe321 /ring.rb |
Initial commit
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 |