Skip to content

Instantly share code, notes, and snippets.

@njh
Created March 27, 2013 18:14
Show Gist options
  • Save njh/5256694 to your computer and use it in GitHub Desktop.
Save njh/5256694 to your computer and use it in GitHub Desktop.
Subscribe to BBC Radio 3 LiveText over MQTT
#!/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