Sha256: b9c6a28cd717a7be2982720652e9ae3b8ccd0f7f77a93052155fdb08609b29d3

Contents?: true

Size: 571 Bytes

Versions: 10

Compression:

Stored size: 571 Bytes

Contents

require 'uri'

require 'murlsh'

module Murlsh

  # Notify PubSubHubbub hubs that feed has been updated.
  class AddPost60NotifyHubs < Plugin

    @hook = 'add_post'

    def self.run(url, config)
      hubs = config.fetch('pubsubhubbub_hubs', [])

      unless hubs.empty?
        require 'push-notify'

        feed_url = URI.join(config.fetch('root_url'), config.fetch('feed_file'))
        begin
          PushNotify::Content.new(feed_url).tell(
            *hubs.map { |h| h.fetch('publish_url') })
        rescue Exception
        end
      end
    end

  end

end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
murlsh-1.9.3 plugins/add_post_60_notify_hubs.rb
murlsh-1.9.2 plugins/add_post_60_notify_hubs.rb
murlsh-1.9.1 plugins/add_post_60_notify_hubs.rb
murlsh-1.9.0 plugins/add_post_60_notify_hubs.rb
murlsh-1.8.0 plugins/add_post_60_notify_hubs.rb
murlsh-1.7.1 plugins/add_post_60_notify_hubs.rb
murlsh-1.7.0 plugins/add_post_60_notify_hubs.rb
murlsh-1.6.1 plugins/add_post_60_notify_hubs.rb
murlsh-1.6.0 plugins/add_post_60_notify_hubs.rb
murlsh-1.5.0 plugins/add_post_60_notify_hubs.rb