Sha256: 8193027916c990478a590e15dec38388df37ac516271815c893855fdf14fb156

Contents?: true

Size: 600 Bytes

Versions: 23

Compression:

Stored size: 600 Bytes

Contents

module Smoke
  module Source # :nodoc:
    # Feed can take multiple rss or atom feeds and munge them up together.
    # 
    # Usage:
    #   Smoke.feed(:ruby) do
    #     url "domain.tld/rss"
    #     url "site.tld/atom"
    #   end
    class Feed < Origin
      attr_reader :requests
      
      def url(feed_uri)
        (@feeds ||= [] ) << feed_uri
      end
      
      protected
      def dispatch
        @requests = @feeds.map{|f| Smoke::Request.new(f, {:raw_response => true}) }
        self.items = @requests.map{|r| ::SimpleRSS.parse(r.body).items }.flatten
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 2 rubygems

Version Path
benschwarz-smoke-0.3.11 lib/smoke/source/feed.rb
benschwarz-smoke-0.4.0 lib/smoke/source/feed.rb
benschwarz-smoke-0.4.1 lib/smoke/source/feed.rb
benschwarz-smoke-0.4.2 lib/smoke/source/feed.rb
benschwarz-smoke-0.5.0 lib/smoke/source/feed.rb
benschwarz-smoke-0.5.1 lib/smoke/source/feed.rb
benschwarz-smoke-0.5.10 lib/smoke/source/feed.rb
benschwarz-smoke-0.5.13 lib/smoke/source/feed.rb
benschwarz-smoke-0.5.2 lib/smoke/source/feed.rb
benschwarz-smoke-0.5.3 lib/smoke/source/feed.rb
benschwarz-smoke-0.5.4 lib/smoke/source/feed.rb
benschwarz-smoke-0.5.5 lib/smoke/source/feed.rb
benschwarz-smoke-0.5.6 lib/smoke/source/feed.rb
benschwarz-smoke-0.5.7 lib/smoke/source/feed.rb
benschwarz-smoke-0.5.8 lib/smoke/source/feed.rb
smoke-0.5.16 lib/smoke/source/feed.rb
smoke-0.5.15 lib/smoke/source/feed.rb
smoke-0.5.14 lib/smoke/source/feed.rb
smoke-0.5.13 lib/smoke/source/feed.rb
smoke-0.5.12 lib/smoke/source/feed.rb