Class: ItemsPage
- Inherits:
-
Page
show all
- Defined in:
- lib/etvnet_seek/core/items_page.rb
Constant Summary
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 Page
#initialize
Methods inherited from ServiceCall
#get, #initialize, #post
Constructor Details
This class inherits a constructor from Page
Instance Method Details
#categories ⇒ Object
27
28
29
30
31
32
33
34
35
36
37
38
39
|
# File 'lib/etvnet_seek/core/items_page.rb', line 27
def categories
list = []
document.css(".movie_menu-onecolumn ul li").each do |item|
href = item.css("a").at(0).attributes['href'].value
text = item.css("a").at(0).text
additional_info = item.css("span.small-text-movie-menu")
list << MediaItem.new(text, href, additional_info)
end
list
end
|
#category_breadcrumbs ⇒ Object
23
24
25
|
# File 'lib/etvnet_seek/core/items_page.rb', line 23
def category_breadcrumbs
collect_links ".info_menu-onecolumn .path_movie_menu"
end
|
#description ⇒ Object
104
105
106
|
# File 'lib/etvnet_seek/core/items_page.rb', line 104
def description
document.css(".description-container").inner_html
end
|
#items ⇒ Object
5
6
7
|
# File 'lib/etvnet_seek/core/items_page.rb', line 5
def items
[]
end
|
17
18
19
20
21
|
# File 'lib/etvnet_seek/core/items_page.rb', line 17
def
list = collect_links "#nav"
list.select { |element| not element =~ /(press|register|persons)/}
end
|
#page_browser ⇒ Object
98
99
100
101
102
|
# File 'lib/etvnet_seek/core/items_page.rb', line 98
def page_browser
node = document.css(".paging .holder").first
node.nil? ? nil : node.inner_html
end
|
#page_title ⇒ Object
13
14
15
|
# File 'lib/etvnet_seek/core/items_page.rb', line 13
def page_title
document.css(".conteiner h1").text
end
|
#see_too_items ⇒ Object
94
95
96
|
# File 'lib/etvnet_seek/core/items_page.rb', line 94
def see_too_items
collect_links ".description .all_next_prev_movie ul li"
end
|
#title ⇒ Object
9
10
11
|
# File 'lib/etvnet_seek/core/items_page.rb', line 9
def title
document.css("title").text
end
|
#title_items ⇒ Object
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
|
# File 'lib/etvnet_seek/core/items_page.rb', line 41
def title_items
list = []
document.css("#table-onecolumn th").each do |item|
link = item.css("a").at(0)
if link
href = link.attributes['href'].value
text = link.text
else
href = nil
text = item.text
end
list << MediaItem.new(text, href)
end
list
end
|