Class: RssIngestor

Inherits:
Object
  • Object
show all
Includes:
Synchroniser::Ingestor::Uri
Defined in:
lib/rss_ingestor.rb

Instance Attribute Summary

Attributes included from Synchroniser::Ingestor

#container

Instance Method Summary collapse

Methods included from Synchroniser::Ingestor::Uri

#load, #pagination, #populate, #strategise

Methods included from Synchroniser::Ingestor

#sync

Instance Method Details

#ingest(container) ⇒ Object



6
7
8
9
10
11
12
# File 'lib/rss_ingestor.rb', line 6

def ingest(container)
  Hpricot(@data).search("rss/channel/item").collect {|item|
    itemise(item, container.clone) 
  }.reject { |item| 
    item.nil? 
  }
end

#itemise(item, container) ⇒ Object



14
15
16
17
18
19
20
# File 'lib/rss_ingestor.rb', line 14

def itemise(item, container)
  container.instance_eval{
    self.url = ((item/"guid").inner_html)
    self.title =  ((item/"title").inner_html)
    self
  }
end