cortex-snippets-client 1.1.6 → 1.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cortex/snippets/version.rb +1 -1
- data/lib/cortex/snippets/webpage.rb +25 -20
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7ae00a884766dfbca402f2a8bff3942a428b444b
|
4
|
+
data.tar.gz: a89ffe893ebf87e8b0783944c409385993be675e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d824cd442c589124cf3c59e265b8863569183bbe83eec7e524749c62ca33ecfcecf9d7081c6fc62a1778ed3ee6bd4cd22093f9510ad28885c40524a31a0a9ea9
|
7
|
+
data.tar.gz: c5a27401f0bf9ecdd12253111fa2eac2104b21d4d80432e912a4d4985f8d64b8bc85d8fb1aa83c2fb70691c5ac42043c86644035ee05e00ef343f051b930cf34
|
@@ -1,20 +1,25 @@
|
|
1
1
|
module Cortex
|
2
2
|
module Snippets
|
3
3
|
class Webpage
|
4
|
+
attr_reader :response, :url, :contents, :status
|
5
|
+
|
4
6
|
def initialize(cortex_client, url)
|
5
|
-
@
|
7
|
+
@url = url
|
8
|
+
@response = cortex_client.webpages.get_feed(url)
|
9
|
+
@status = @response.status
|
10
|
+
@contents = @response.contents
|
6
11
|
end
|
7
12
|
|
8
13
|
def seo_title
|
9
|
-
@
|
14
|
+
@contents[:seo_title]
|
10
15
|
end
|
11
16
|
|
12
17
|
def seo_description
|
13
|
-
@
|
18
|
+
@contents[:seo_description]
|
14
19
|
end
|
15
20
|
|
16
21
|
def seo_keywords
|
17
|
-
@
|
22
|
+
@contents[:seo_keyword_list]
|
18
23
|
end
|
19
24
|
|
20
25
|
def seo_robots
|
@@ -22,45 +27,45 @@ module Cortex
|
|
22
27
|
index_options = [:noindex, :nofollow, :noodp, :nosnippet, :noarchive, :noimageindex]
|
23
28
|
|
24
29
|
index_options.each do |index_option|
|
25
|
-
robot_information << index_option if @
|
30
|
+
robot_information << index_option if @contents[index_option]
|
26
31
|
end
|
27
32
|
|
28
33
|
robot_information
|
29
34
|
end
|
30
35
|
|
31
36
|
def noindex
|
32
|
-
@
|
37
|
+
@contents[:noindex]
|
33
38
|
end
|
34
39
|
|
35
40
|
def nofollow
|
36
|
-
@
|
41
|
+
@contents[:nofollow]
|
37
42
|
end
|
38
43
|
|
39
44
|
def noodp
|
40
|
-
@
|
45
|
+
@contents[:noodp]
|
41
46
|
end
|
42
47
|
|
43
48
|
def nosnippet
|
44
|
-
@
|
49
|
+
@contents[:nosnippet]
|
45
50
|
end
|
46
51
|
|
47
52
|
def noarchive
|
48
|
-
@
|
53
|
+
@contents[:noarchive]
|
49
54
|
end
|
50
55
|
|
51
56
|
def noimageindex
|
52
|
-
@
|
57
|
+
@contents[:noimageindex]
|
53
58
|
end
|
54
59
|
|
55
60
|
def dynamic_yield
|
56
61
|
{
|
57
|
-
sku: @
|
58
|
-
category: @
|
62
|
+
sku: @contents[:dynamic_yield_sku],
|
63
|
+
category: @contents[:dynamic_yield_category]
|
59
64
|
}
|
60
65
|
end
|
61
66
|
|
62
67
|
def tables_widget_data
|
63
|
-
JSON.parse(@
|
68
|
+
JSON.parse(@contents[:tables_widget_json] || 'null', quirks_mode: true)
|
64
69
|
end
|
65
70
|
|
66
71
|
def tables_widget_data_for(section_name)
|
@@ -68,7 +73,7 @@ module Cortex
|
|
68
73
|
end
|
69
74
|
|
70
75
|
def carousels_widget_data
|
71
|
-
JSON.parse(@
|
76
|
+
JSON.parse(@contents[:carousels_widget_json] || 'null', quirks_mode: true)
|
72
77
|
end
|
73
78
|
|
74
79
|
def carousels_widget_data_for(section_name)
|
@@ -76,7 +81,7 @@ module Cortex
|
|
76
81
|
end
|
77
82
|
|
78
83
|
def galleries_widget_data
|
79
|
-
JSON.parse(@
|
84
|
+
JSON.parse(@contents[:galleries_widget_json] || 'null', quirks_mode: true)
|
80
85
|
end
|
81
86
|
|
82
87
|
def galleries_widget_data_for(section_name)
|
@@ -84,7 +89,7 @@ module Cortex
|
|
84
89
|
end
|
85
90
|
|
86
91
|
def accordion_group_widget_data
|
87
|
-
JSON.parse(@
|
92
|
+
JSON.parse(@contents[:accordion_group_widget_json] || 'null', quirks_mode: true)
|
88
93
|
end
|
89
94
|
|
90
95
|
def accordion_group_widget_data_for(section_name)
|
@@ -92,11 +97,11 @@ module Cortex
|
|
92
97
|
end
|
93
98
|
|
94
99
|
def charts_widget_data
|
95
|
-
JSON.parse(@
|
100
|
+
JSON.parse(@contents[:charts_widget_json] || 'null', quirks_mode: true)
|
96
101
|
end
|
97
102
|
|
98
103
|
def buy_box_widget_data
|
99
|
-
JSON.parse(@
|
104
|
+
JSON.parse(@contents[:buy_box_widget_json] || 'null', quirks_mode: true)
|
100
105
|
end
|
101
106
|
|
102
107
|
def charts_widget_data_for(section_name)
|
@@ -104,7 +109,7 @@ module Cortex
|
|
104
109
|
end
|
105
110
|
|
106
111
|
def snippets
|
107
|
-
@
|
112
|
+
@contents[:snippets]
|
108
113
|
end
|
109
114
|
end
|
110
115
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cortex-snippets-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- CareerBuilder Employer Site & Content Products
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-12-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cortex-client
|