I need to write an endpoint to receive pings and feeds from PSHB hub as new content is published. I know there are some libs on Ruby, like https://github.com/igrigorik/PubSubHubbub for example, but cannot figure out how to implement a Ruby on Rails callback with a reactor code like the following:
require "rubygems"
require "pubsubhubbub"
EventMachine.run {
# publish single URL
pub = EventMachine::PubSubHubbub.new('http://pubsubhubbub.appspot.com/publish').publish "http://www.test.com/one-feed.atom"
pub.callback { puts "Successfully notified hub." }
pub.errback { puts "Uh oh, something broke: #{pub.response}" }
}
thanks in advance luca