wedding_registry_scraper 0.0.4 → 0.0.5
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: a465ddaeee431049efa8067c9d06e261c0f8a0be
|
4
|
+
data.tar.gz: c552ff0e195de60c8e921b4d8735b9fa5590d0ba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8a2acb4103b4958ad7e1a6df069d726cbc3c33bf03f96cfaf39e1a420a5bf4ed0648ef4230f6672942de5072d2d0021dd23f31515097da5adf923b122482aaa6
|
7
|
+
data.tar.gz: cceef06629a982910be1aae58af295ad290a9b500ef6dce31a95ba4658042b81ee38449a97762ef134fd350f5abac80ed68ffcbd1a5ae146d13973c885646c04
|
@@ -0,0 +1,39 @@
|
|
1
|
+
class WeddingRegistryScraper::Registries::PotteryBarn < WeddingRegistryScraper::Registry
|
2
|
+
@display_name = "Pottery Barn"
|
3
|
+
@domain = "potterybarn.com"
|
4
|
+
private
|
5
|
+
def get_products(doc)
|
6
|
+
doc.css('.regListItem')
|
7
|
+
end
|
8
|
+
|
9
|
+
def get_name(product)
|
10
|
+
product.css('.product-name').text.strip
|
11
|
+
end
|
12
|
+
|
13
|
+
def get_sku(product)
|
14
|
+
sku = product.css('.product-sku').text.strip
|
15
|
+
"potterybarn:#{sku}"
|
16
|
+
end
|
17
|
+
|
18
|
+
def get_url(product)
|
19
|
+
# TODO pop up modal? set proper anchor (they're not unique!)
|
20
|
+
@url
|
21
|
+
end
|
22
|
+
|
23
|
+
def get_image_url(product)
|
24
|
+
thumb_src = product.css('.product-image img')[0]['src']
|
25
|
+
thumb_src.sub(/f\.jpg$/, 'c.jpg')
|
26
|
+
end
|
27
|
+
|
28
|
+
def get_remaining(product)
|
29
|
+
product.css('.still-needs').text.strip.to_i
|
30
|
+
end
|
31
|
+
|
32
|
+
def get_desired(product)
|
33
|
+
product.css('.requested').text.strip.to_i
|
34
|
+
end
|
35
|
+
|
36
|
+
def get_price(product)
|
37
|
+
product.css('.product-price .price-amount').text.to_f
|
38
|
+
end
|
39
|
+
end
|
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.5
|
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-06-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: unirest
|
@@ -71,6 +71,7 @@ files:
|
|
71
71
|
- lib/wedding_registry_scraper/registries.rb
|
72
72
|
- lib/wedding_registry_scraper/registries/crate_and_barrel.rb
|
73
73
|
- lib/wedding_registry_scraper/registries/heath_ceramics.rb
|
74
|
+
- lib/wedding_registry_scraper/registries/pottery_barn.rb
|
74
75
|
- lib/wedding_registry_scraper/registries/rei.rb
|
75
76
|
- lib/wedding_registry_scraper/registries/williams_sonoma.rb
|
76
77
|
- lib/wedding_registry_scraper/registries/zola.rb
|