Subscribe to BBC Radio 3 LiveText over MQTT
This file contains 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
#!/usr/bin/env ruby | |
# | |
# Subscribe to BBC Radio 3 LiveText over MQTT | |
# | |
require 'rubygems' | |
require 'mqtt' | |
MQTT::Client.connect('test.mosquitto.org') do |c| | |
# If you pass a block to the get method, then it will loop | |
c.get('bbc/livetext/radio3') do |topic,message| | |
puts message | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment