Class: AnnouncesPage

Inherits:
MediaPage show all
Defined in:
lib/etvnet_seek/core/announces_page.rb

Constant Summary collapse

ANNOUNCES_URL =
BASE_URL + "/announces.html"

Constants inherited from Page

Page::BASE_URL

Instance Attribute Summary

Attributes inherited from Page

#document

Attributes inherited from ServiceCall

#url

Instance Method Summary collapse

Methods inherited from BasePage

#page_title, #title

Methods inherited from ServiceCall

#get, #post

Constructor Details

#initializeAnnouncesPage

Returns a new instance of AnnouncesPage.



4
5
6
# File 'lib/etvnet_seek/core/announces_page.rb', line 4

def initialize()
  super(ANNOUNCES_URL)
end

Instance Method Details

#category_breadcrumbsObject



8
9
10
# File 'lib/etvnet_seek/core/announces_page.rb', line 8

def category_breadcrumbs
  []
end

#itemsObject



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/etvnet_seek/core/announces_page.rb', line 12

def items
  list = []

  document.css("table tr td div").each do |item|
    unless item.css("a").at(0).nil?
      image = item.css("img").at(0).attributes['src'].value.strip

      unless image == 'images/banner_announces.jpg'
        text = item.css("img").at(0).attributes['alt'].value.strip
        href = item.css("a").at(0).attributes['href'].value
        image = item.css("img").at(0).attributes['src'].value.strip

        record = BrowseMediaItem.new(text, href)
        record.image = image

        list << record
      end
    end
  end

  list
end