Module: Html2rss

Defined in:
lib/html2rss.rb,
lib/html2rss/item.rb,
lib/html2rss/config.rb,
lib/html2rss/version.rb,
lib/html2rss/feed_builder.rb,
lib/html2rss/item_extractor.rb,
lib/html2rss/attribute_post_processors.rb,
lib/html2rss/attribute_post_processors/template.rb,
lib/html2rss/attribute_post_processors/parse_uri.rb,
lib/html2rss/attribute_post_processors/substring.rb,
lib/html2rss/attribute_post_processors/parse_time.rb,
lib/html2rss/attribute_post_processors/sanitize_html.rb

Defined Under Namespace

Modules: AttributePostProcessors, ItemExtractor Classes: Config, FeedBuilder, Item

Constant Summary collapse

VERSION =
'0.3.0'.freeze

Class Method Summary collapse

Class Method Details

.feed(config) ⇒ Object



16
17
18
19
# File 'lib/html2rss.rb', line 16

def self.feed(config)
  feed = FeedBuilder.new config
  feed.rss
end

.feed_from_yaml_config(file, name) ⇒ Object



7
8
9
10
11
12
13
14
# File 'lib/html2rss.rb', line 7

def self.feed_from_yaml_config(file, name)
  yaml = YAML.load(File.open(file))
  feed_config = yaml['feeds'][name]
  global_config = yaml.reject { |k| k == 'feeds' }

  config = Config.new(feed_config, global_config)
  feed(config)
end