Class: MediaPage
- Inherits:
-
BasePage
- Object
- ServiceCall
- Page
- BasePage
- MediaPage
- Defined in:
- lib/etvnet_seek/core/media_page.rb
Direct Known Subclasses
Constant Summary
Constants inherited from Page
Instance Attribute Summary
Attributes inherited from Page
Attributes inherited from ServiceCall
Instance Method Summary collapse
Methods inherited from BasePage
Methods inherited from Page
Methods inherited from ServiceCall
Constructor Details
This class inherits a constructor from Page
Instance Method Details
#items ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/etvnet_seek/core/media_page.rb', line 2 def items list = [] document.css("b a.media_file").each do |item| link = item.attributes['href'].value new_link = list.select {|l| l.link == link}.empty? if new_link text = item.content.strip additional_info = additional_info(item, 1) text += additional_info unless additional_info.nil? tr = item.parent.parent.parent showtime = tr.css("td[1]").text.strip year = tr.css("td[4]") ? tr.css("td[4]").text.strip : "" duration = tr.css("td[5]").text.strip ? tr.css("td[5]").text.strip : "" channel = tr.css("td[6]") ? tr.css("td[6]").text.strip : "" if link =~ /action=browse_container/ folder = true link = link[Page::BASE_URL.size..link.size] else folder = false end record = BrowseMediaItem.new(text, link) record.folder = folder record.showtime = showtime record.year = year record.duration = duration record.channel = channel list << record end end list end |