Class: ChannelsPage
- Defined in:
- lib/etvnet_seek/core/channels_page.rb
Constant Summary collapse
- BROWSE_URL =
BASE_URL + "/cgi-bin/video/eitv_browse.fcgi"
- CHANNELS_URL =
BROWSE_URL + "?action=channels"
Constants inherited from Page
Instance Attribute Summary
Attributes inherited from Page
Attributes inherited from ServiceCall
Instance Method Summary collapse
-
#initialize(url = CHANNELS_URL) ⇒ ChannelsPage
constructor
A new instance of ChannelsPage.
- #items ⇒ Object
Methods inherited from BasePage
Methods inherited from ServiceCall
Constructor Details
#initialize(url = CHANNELS_URL) ⇒ ChannelsPage
Returns a new instance of ChannelsPage.
5 6 7 |
# File 'lib/etvnet_seek/core/channels_page.rb', line 5 def initialize url = CHANNELS_URL super(url) end |
Instance Method Details
#items ⇒ Object
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 |
# File 'lib/etvnet_seek/core/channels_page.rb', line 9 def items list = [] document.css("table table table.rounded_white table tr").each do |item| links = item.css("table tr td a") text = item.children.at(0).text.strip if text.size > 0 link = nil archive_link = nil if links.size > 0 href = links[0] archive_href = links[1] link = href.attributes['href'].value unless href.nil? archive_link = archive_href.attributes['href'].value unless archive_href.nil? end list << ChannelMediaItem.new(text, link, archive_link) unless link.nil? end end list end |