Class: FreetvPage
- Defined in:
- lib/etvnet_seek/core/freetv_page.rb
Constant Summary collapse
- FREETV_URL =
BASE_URL + "/freeTV.html"
Constants inherited from Page
Instance Attribute Summary
Attributes inherited from Page
Attributes inherited from ServiceCall
Instance Method Summary collapse
- #category_breadcrumbs ⇒ Object
-
#initialize ⇒ FreetvPage
constructor
A new instance of FreetvPage.
- #items ⇒ Object
Methods inherited from BasePage
Methods inherited from ServiceCall
Constructor Details
#initialize ⇒ FreetvPage
Returns a new instance of FreetvPage.
4 5 6 |
# File 'lib/etvnet_seek/core/freetv_page.rb', line 4 def initialize super(FREETV_URL) end |
Instance Method Details
#category_breadcrumbs ⇒ Object
8 9 10 |
# File 'lib/etvnet_seek/core/freetv_page.rb', line 8 def [] end |
#items ⇒ Object
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 |
# File 'lib/etvnet_seek/core/freetv_page.rb', line 12 def items list = [] document.css("table tr").each do |item| node = item.css("td img") if node.size > 0 text = node.at(0).parent.css("a") unless text.to_s.size == 0 link = node.at(0).parent.css("a") text = link.at(0).text.gsub(/\s\s+/, ' ') = node.at(0).attributes['src'] image = link.at(0).parent.parent.previous.css("td img").at(0).attributes['src'].value.strip href = link.at(0).attributes['href'].value.strip record = BrowseMediaItem.new(text, href) record. = record.image = image list << record end end end list end |