diaspora/lib/pubsubhubbub.rb

17 lines
511 B
Ruby

# Copyright (c) 2010, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.
class Pubsubhubbub
H = {"User-Agent" => "PubSubHubbub Ruby", "Content-Type" => "application/x-www-form-urlencoded"}
def initialize(hub, options={})
@headers = H.merge(options[:head]) if options[:head]
@hub = hub
end
def publish(feed)
RestClient.post(@hub, :headers => @headers, 'hub.url' => feed, 'hub.mode' => 'publish')
end
end