Method: ColRead::Core#contents
- Defined in:
- lib/colread.rb
#contents(chapters) ⇒ Object
22 23 24 25 26 27 28 29 |
# File 'lib/colread.rb', line 22 def contents chapters chapters.each do |a| href=a['href'].start_with?('http') ? a['href'] : @root+a['href'] source = open(href).read.encode('utf-8') content=Nokogiri::HTML(Readability::Document.new(source).content).text yield [a.text, content] end end |