Class: RssIngestor
Instance Attribute Summary
#container
Instance Method Summary
collapse
#load, #pagination, #populate, #strategise
#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
|