Module: Omnom::SourceParsers::Feedburner

Included in:
Omnom::Source::Techcrunch::Default, Omnom::Source::TheNextWeb::Default
Defined in:
lib/omnom/source_parsers/feedburner.rb

Instance Method Summary collapse

Instance Method Details

#get_raw_postsObject



4
5
6
# File 'lib/omnom/source_parsers/feedburner.rb', line 4

def get_raw_posts
  @page.search('channel > item')
end

#post_attributes(node) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/omnom/source_parsers/feedburner.rb', line 8

def post_attributes(node)
  node.document.root.add_namespace('feedburner', 'http://rssnamespace.org/feedburner/ext/1.0')
  link = node.>('feedburner|origLink').first
  link = node.>('link').first if link.blank?
  {
    title: node.>('title').first.text,
    description: node.>('description').first.text,
    guid: node.>('guid').first.text,
    url: link.text,
    published_at: node.>('pubDate').first.time,
    thumbnail_url: node.drill([:>, 'media|thumbnail'], :first, [:attr, 'url']),
    author_name: node.>('dc|creator').first.text,
    tags: node.>('category').map(&:text) - ['TC']
  }
end