Created
September 8, 2014 06:09
-
-
Save chobie/5386e46a7b9dad2276e3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'mqtt' | |
username = "example@github" | |
password = "password" | |
client = MQTT::Client.connect(:host => 'free.mqtt.shiguredo.jp', :port => 1883, :username => username, :password => password) | |
client.subscribe("#{username}/debug") | |
client.publish("#{username}/debug", "helo", 0) | |
client.get do |topic,message| | |
print topic | |
print message | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment