Skip to content

Instantly share code, notes, and snippets.

@nivertech
Forked from njh/mqtt-livetext-radio3.rb
Created March 28, 2013 23:49
Show Gist options
  • Select an option

  • Save nivertech/5267754 to your computer and use it in GitHub Desktop.

Select an option

Save nivertech/5267754 to your computer and use it in GitHub Desktop.
#!/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