wedding_registry_scraper 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5d8773e57fa2aff9cfceea050e4ee16713cb75f9
|
4
|
+
data.tar.gz: 373b3abffa0e75eebb28234c08f4ae29d19d36c6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 52f046314cabb11d5251e82e37b8f9d7cfadf63804f696cc65f3f3375daa2cde8e19e00a3c80caefd36db36bc92be77349476110bf745fca93acd140dc6f8822
|
7
|
+
data.tar.gz: 0841a1975c3fc383e48af6d8b1bf0d1e603258233e64c9f940bd56db00dbe554c2fb5f314bddf97542ea7f97b2ae8580aebbcc0f996632206f6473d3bd5bb03d
|
@@ -3,8 +3,9 @@ class WeddingRegistryScraper::Registries::Rei < WeddingRegistryScraper::Registry
|
|
3
3
|
@domain = "rei.com"
|
4
4
|
private
|
5
5
|
def get_product_details_url(product)
|
6
|
-
|
7
|
-
|
6
|
+
link = product.css('a[name=prod]')
|
7
|
+
return if link.empty?
|
8
|
+
"https://www.rei.com/#{link[0]['href'].sub(/^\/?/, '')}"
|
8
9
|
end
|
9
10
|
|
10
11
|
def get_products(doc)
|
@@ -12,11 +13,11 @@ private
|
|
12
13
|
end
|
13
14
|
|
14
15
|
def get_name(product)
|
15
|
-
product.css('
|
16
|
+
product.css('td')[1].children.first.text.strip
|
16
17
|
end
|
17
18
|
|
18
19
|
def get_sku(product)
|
19
|
-
sku =
|
20
|
+
sku = product.css('td')[1].children.last.text.strip
|
20
21
|
"rei-#{sku}"
|
21
22
|
end
|
22
23
|
|
@@ -26,6 +27,7 @@ private
|
|
26
27
|
|
27
28
|
def get_image_url(product)
|
28
29
|
details_url = get_product_details_url(product)
|
30
|
+
return "" if details_url.blank?
|
29
31
|
|
30
32
|
puts "GET #{details_url.inspect}" if @debug
|
31
33
|
result = Unirest.get(details_url)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wedding_registry_scraper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Pariser
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-08-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: unirest
|