Sha256: d633a075cec86bf377141b9755d5f51837ff555c3b26dd44c30b0881352a92e2

Contents?: true

Size: 538 Bytes

Versions: 2

Compression:

Stored size: 538 Bytes

Contents

%w{
murlsh
}.each { |m| require m }

module Murlsh

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

    @hook = 'add_post'

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

      unless hubs.empty?
        require 'push-notify'

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

  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
murlsh-0.11.0 plugins/add_post_60_notify_hubs.rb
murlsh-0.10.0 plugins/add_post_60_notify_hubs.rb