Using Xmpp4r-simple for Superfeedr

I was looking for a simple way to integrate feeds subscriptions and unsubscriptions into my application and most of the wrappers that were on Superfeedr were sort of designed to be run as a daemon service, which really wasn't what I needed .. so I Googled around a little and found this nifty Ruby library called xmpp4r-simple .. and there were patches added to it to enable it talk pubsub .. 

But seems like the author has hardcoded the pubsub JID which starts with "pubsub." .. which doesn't work with Superfeedr.

So I changed the main library file a little to add another parameters so you can specify which JID it should talk to .. Here's what you need to do

  • Download my patched xmpp4r-simple.rb
  • Replace it with the same file on your downloaded xmpp4r-simple source (should be cloned from git as shown previously)
  • Build it into a gem and install it (Also shown in my previous posting)

 

Now that you have gotten the patched gem installed into your gem store, you can pass in the new default service JID in the new constructor. Sample code below :

require 'rubygems' 

require 'xmpp4r-simple'

Jabber::debug = true

im1 = Jabber::Simple.new "account@superfeedr.com" , "yourpassword" , nil , "Available" , nil , 5222 , "firehoser.superfeedr.com"

im1.pubsubscribe_to("http://somerssfeed.xml")


 

 

 

 

Posted 5 months ago

0 comments

Leave a comment...

 
To leave a comment on this posterous, please login by clicking one of the following.
Posterous-login     twitter