Skip to content

Instantly share code, notes, and snippets.

@njh
Created July 14, 2011 14:51
Show Gist options
  • Select an option

  • Save njh/1082601 to your computer and use it in GitHub Desktop.

Select an option

Save njh/1082601 to your computer and use it in GitHub Desktop.
Script to display the available pubsub nodes on the BBC push feeds server
#!/usr/bin/ruby
require 'rubygems'
require 'xmpp4r'
require 'xmpp4r/pubsub'
require 'xmpp4r/pubsub/helper/nodebrowser.rb'
require 'pp'
HOST = 'push.bbc.co.uk'
SERVICE = 'pubsub.push.bbc.co.uk'
# connect XMPP client
jid = Jabber::JID.new("sub@push.bbc.co.uk")
client = Jabber::Client.new(jid)
client.connect(HOST)
puts "CONNECTING: anonymously"
client.auth_anonymous_sasl
browser = Jabber::PubSub::NodeBrowser.new(client)
pp browser.nodes(SERVICE)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment