product_spy 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +15 -0
- data/lib/product_spy/host.rb +1 -1
- data/lib/product_spy/version.rb +1 -1
- data/lib/product_spy.rb +46 -2
- data/spec/anzberg-shop.de_spec.rb +29 -0
- data/spec/baby-markt_spec.rb +28 -0
- data/spec/baby-walz.de_spec.rb +28 -0
- data/spec/ebay_spec.rb +29 -0
- data/spec/hornbach.de_spec.rb +28 -0
- data/spec/lecreuset.de_spec.rb +40 -0
- data/spec/porzellanhandel24.de_spec.rb +40 -0
- metadata +15 -1
data/README.md
CHANGED
@@ -49,6 +49,21 @@ ProductSpy.setup do |config|
|
|
49
49
|
end
|
50
50
|
```
|
51
51
|
|
52
|
+
## Supported shops
|
53
|
+
|
54
|
+
The following shops are already set up in the gem, but you are able each
|
55
|
+
shop you want to in the configuration of your abblication or you can
|
56
|
+
contribute new shops.
|
57
|
+
|
58
|
+
* www.amazon.de
|
59
|
+
* www.arzberg-shop.de
|
60
|
+
* www.baby-markt.de
|
61
|
+
* www.baby-walz.de
|
62
|
+
* www.ebay.de
|
63
|
+
* www.hornbach.de
|
64
|
+
* www.lecreuset.de
|
65
|
+
* www.porzellanhandel24.de
|
66
|
+
|
52
67
|
## Contributing
|
53
68
|
|
54
69
|
1. Fork it
|
data/lib/product_spy/host.rb
CHANGED
data/lib/product_spy/version.rb
CHANGED
data/lib/product_spy.rb
CHANGED
@@ -10,16 +10,60 @@ module ProductSpy
|
|
10
10
|
# ** Mobile
|
11
11
|
# http://www.amazon.de/gp/aw/d/B004O9DF7I/ref=aw_d_var_2nd_sports_img?vs=1
|
12
12
|
# http://www.amazon.de/gp/aw/B000K7BELW/ref=aw_imgblk_0?h=356&ie=UTF8&selIdx=0&tag=viddleit-21&w=320
|
13
|
-
host.parse /^http[s]{0,1}:\/\/(www\.|)amazon
|
13
|
+
host.parse /^http[s]{0,1}:\/\/(www\.|)amazon\.de\/gp\/aw(\/d|)\/([A-Z0-9]{10})(\/.*|)$/, [3]
|
14
14
|
|
15
15
|
# ** Desktop
|
16
16
|
# http://www.amazon.de/Hauck-662984-Hochstuhl-Alpha-natur/dp/B000K7BELW/ref=sr_1_2?s=baby&ie=UTF8&qid=1360979509&sr=1-2
|
17
17
|
# http://www.amazon.de/dp/B000K7BELW/
|
18
|
-
host.parse /^http[s]{0,1}:\/\/(www\.|)amazon
|
18
|
+
host.parse /^http[s]{0,1}:\/\/(www\.|)amazon\.de(\/.*?|)\/dp\/([A-Z0-9]{10})(\/.*|)$/, [3]
|
19
19
|
|
20
20
|
host.build :default, 'https://www.amazon.de/dp/:1'
|
21
21
|
host.build :mobile, 'https://www.amazon.de/gp/aw/d/:1'
|
22
22
|
end
|
23
|
+
|
24
|
+
config.host 'www.baby-markt.de', :aliases => ['baby-markt.de'] do |host|
|
25
|
+
# http://www.baby-markt.de/Markenhersteller/Reer/Heizstrahler/REER-1909-Wickeltisch-Heizstrahler-mit-Standfuss.html
|
26
|
+
host.parse /^http[s]{0,1}:\/\/(www.|)baby-markt\.de(\/.*?)(\?.*|)$/, [2]
|
27
|
+
|
28
|
+
host.build :default, 'https://www.baby-markt.de:1'
|
29
|
+
end
|
30
|
+
|
31
|
+
config.host 'www.ebay.de', :aliases => ['ebay.de'] do |host|
|
32
|
+
# http://www.ebay.de/itm/(390542152250)
|
33
|
+
# http://www.ebay.de/itm/Inspirierende-Ferienhauser-/(390542152250)?pt=Sach_Fachb%C3%BCcher&hash=item5aee20523a#ht_500wt_948
|
34
|
+
host.parse /^http[s]{0,1}:\/\/(www.|)ebay\.de\/itm(\/.+?|)\/(\d+)/, [3]
|
35
|
+
host.build :default, 'https://www.ebay.de/itm/:1'
|
36
|
+
end
|
37
|
+
|
38
|
+
config.host 'www.arzberg-shop.de', :aliases => ['arzberg-shop.de'] do |host|
|
39
|
+
# http://www.arzberg-shop.de/product_info.php/(info/p9845_Kuchenplatte-eckig-35-cm------1382--Weiss.html)
|
40
|
+
host.parse /^http[s]{0,1}:\/\/(www.|)arzberg-shop\.de\/product_info\.php\/(.*?)(\?.*|)$/, [2]
|
41
|
+
host.build :default, 'http://www.arzberg-shop.de/product_info.php/:1'
|
42
|
+
end
|
43
|
+
|
44
|
+
config.host 'www.lecreuset.de', :aliases => ['lecreuset.de'] do |host|
|
45
|
+
# http://www.lecreuset.de/Produkte-/(Gusseisen/Klassische-Brater/Brater-Tradition-rund-24cm)/
|
46
|
+
host.parse /^http[s]{0,1}:\/\/(www.|)lecreuset\.de\/Produkte-\/(.+?)(\/|)(\?.*|)$/, [2]
|
47
|
+
host.build :default, 'http://www.lecreuset.de/Produkte-/:1/'
|
48
|
+
end
|
49
|
+
|
50
|
+
config.host 'www.porzellanhandel24.de', :aliases => ['porzellanhandel24.de'] do |host|
|
51
|
+
# http://www.porzellanhandel24.de/(villeroy-boch-royal-becher-mit-henkel)/?refID=froogle&gclid=CL7Z-K63zrQCFXHLtAodTVoA5w
|
52
|
+
host.parse /^http[s]{0,1}:\/\/(www.|)porzellanhandel24\.de\/(.+?)(\/|)(\?.*|)$/, [2]
|
53
|
+
host.build :default, 'https://www.porzellanhandel24.de/:1'
|
54
|
+
end
|
55
|
+
|
56
|
+
config.host 'www.hornbach.de', :aliases => ['hornbach.de'] do |host|
|
57
|
+
# http://www.hornbach.de/shop/(HORNBACH-Projektbuch)/(7395450)/artikel.html?sourceCat=S1405&WT.svl=artikel_text
|
58
|
+
host.parse /^http[s]{0,1}:\/\/(www.|)hornbach\.de\/shop\/(.+?)\/(\d+?)\/artikel\.html(\?.*|)$/, [2,3]
|
59
|
+
host.build :default, 'https://www.hornbach.de/shop/:1/:2/artikel.html'
|
60
|
+
end
|
61
|
+
|
62
|
+
config.host 'www.baby-walz.de', :aliases => ['baby-walz.de'] do |host|
|
63
|
+
# http://www.baby-walz.de/(Rassel-Soeckchen-321588).html?group=3020165&pgpkl=cad489c2d189d388b31a2206fd609664
|
64
|
+
host.parse /^http[s]{0,1}:\/\/(www.|)baby-walz\.de\/(.+?)\.html(\?.*|)$/, [2]
|
65
|
+
host.build :default, 'https://www.baby-walz.de/:1.html'
|
66
|
+
end
|
23
67
|
end
|
24
68
|
|
25
69
|
# Build the url for a given host and primary key
|
@@ -0,0 +1,29 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
# http://www.arzberg-shop.de/product_info.php/(info/p9845_Kuchenplatte-eckig-35-cm------1382--Weiss.html)
|
3
|
+
describe ProductSpy, 'anzberg-shop.de' do
|
4
|
+
context 'parse url' do
|
5
|
+
it 'parses: https://www.arzberg-shop.de/product_info.php/info/p9845_Kuchenplatte-eckig-35-cm------1382--Weiss.html' do
|
6
|
+
host, pk = ProductSpy.parse('https://www.arzberg-shop.de/product_info.php/info/p9845_Kuchenplatte-eckig-35-cm------1382--Weiss.html')
|
7
|
+
host.should == 'www.arzberg-shop.de'
|
8
|
+
pk.should == ['info/p9845_Kuchenplatte-eckig-35-cm------1382--Weiss.html']
|
9
|
+
end
|
10
|
+
|
11
|
+
it 'parses: http://www.arzberg-shop.de/product_info.php/info/p9845_Kuchenplatte-eckig-35-cm------1382--Weiss.html' do
|
12
|
+
host, pk = ProductSpy.parse('http://www.arzberg-shop.de/product_info.php/info/p9845_Kuchenplatte-eckig-35-cm------1382--Weiss.html')
|
13
|
+
host.should == 'www.arzberg-shop.de'
|
14
|
+
pk.should == ['info/p9845_Kuchenplatte-eckig-35-cm------1382--Weiss.html']
|
15
|
+
end
|
16
|
+
|
17
|
+
it 'parses: http://www.arzberg-shop.de/product_info.php/info/p9845_Kuchenplatte-eckig-35-cm------1382--Weiss.html?x=y' do
|
18
|
+
host, pk = ProductSpy.parse('http://www.arzberg-shop.de/product_info.php/info/p9845_Kuchenplatte-eckig-35-cm------1382--Weiss.html?x=y')
|
19
|
+
host.should == 'www.arzberg-shop.de'
|
20
|
+
pk.should == ['info/p9845_Kuchenplatte-eckig-35-cm------1382--Weiss.html']
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
context 'build url' do
|
25
|
+
it 'returns: http://www.arzberg-shop.de/product_info.php/info/p9845_Kuchenplatte-eckig-35-cm------1382--Weiss.html' do
|
26
|
+
ProductSpy.build('www.arzberg-shop.de', ['info/p9845_Kuchenplatte-eckig-35-cm------1382--Weiss.html']).should == 'http://www.arzberg-shop.de/product_info.php/info/p9845_Kuchenplatte-eckig-35-cm------1382--Weiss.html'
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
describe ProductSpy, 'baby-markt' do
|
3
|
+
context 'parse url' do
|
4
|
+
it 'parses: https://www.baby-markt.de/Markenhersteller/Reer/Heizstrahler/REER-1909-Wickeltisch-Heizstrahler-mit-Standfuss.html' do
|
5
|
+
host, pk = ProductSpy.parse('https://www.baby-markt.de/Markenhersteller/Reer/Heizstrahler/REER-1909-Wickeltisch-Heizstrahler-mit-Standfuss.html')
|
6
|
+
host.should == 'www.baby-markt.de'
|
7
|
+
pk.should == ['/Markenhersteller/Reer/Heizstrahler/REER-1909-Wickeltisch-Heizstrahler-mit-Standfuss.html']
|
8
|
+
end
|
9
|
+
|
10
|
+
it 'parses: http://www.baby-markt.de/Markenhersteller/Reer/Heizstrahler/REER-1909-Wickeltisch-Heizstrahler-mit-Standfuss.html' do
|
11
|
+
host, pk = ProductSpy.parse('http://www.baby-markt.de/Markenhersteller/Reer/Heizstrahler/REER-1909-Wickeltisch-Heizstrahler-mit-Standfuss.html')
|
12
|
+
host.should == 'www.baby-markt.de'
|
13
|
+
pk.should == ['/Markenhersteller/Reer/Heizstrahler/REER-1909-Wickeltisch-Heizstrahler-mit-Standfuss.html']
|
14
|
+
end
|
15
|
+
|
16
|
+
it 'parses: http://www.baby-markt.de/Markenhersteller/Reer/Heizstrahler/REER-1909-Wickeltisch-Heizstrahler-mit-Standfuss.html?x=y' do
|
17
|
+
host, pk = ProductSpy.parse('http://www.baby-markt.de/Markenhersteller/Reer/Heizstrahler/REER-1909-Wickeltisch-Heizstrahler-mit-Standfuss.html?x=y')
|
18
|
+
host.should == 'www.baby-markt.de'
|
19
|
+
pk.should == ['/Markenhersteller/Reer/Heizstrahler/REER-1909-Wickeltisch-Heizstrahler-mit-Standfuss.html']
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
context 'build url' do
|
24
|
+
it 'returns: https://www.baby-markt.de/Markenhersteller/Reer/Heizstrahler/REER-1909-Wickeltisch-Heizstrahler-mit-Standfuss.html' do
|
25
|
+
ProductSpy.build('www.baby-markt.de', ['/Markenhersteller/Reer/Heizstrahler/REER-1909-Wickeltisch-Heizstrahler-mit-Standfuss.html']).should == 'https://www.baby-markt.de/Markenhersteller/Reer/Heizstrahler/REER-1909-Wickeltisch-Heizstrahler-mit-Standfuss.html'
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
describe ProductSpy, 'baby-walz.de' do
|
3
|
+
context 'parse url' do
|
4
|
+
it 'parses: https://www.baby-walz.de/Rassel-Soeckchen-321588.html' do
|
5
|
+
host, pk = ProductSpy.parse('https://www.baby-walz.de/Rassel-Soeckchen-321588.html')
|
6
|
+
host.should == 'www.baby-walz.de'
|
7
|
+
pk.should == ['Rassel-Soeckchen-321588']
|
8
|
+
end
|
9
|
+
|
10
|
+
it 'parses: http://www.baby-walz.de/Rassel-Soeckchen-321588.html' do
|
11
|
+
host, pk = ProductSpy.parse('http://www.baby-walz.de/Rassel-Soeckchen-321588.html')
|
12
|
+
host.should == 'www.baby-walz.de'
|
13
|
+
pk.should == ['Rassel-Soeckchen-321588']
|
14
|
+
end
|
15
|
+
|
16
|
+
it 'parses: http://www.baby-walz.de/Rassel-Soeckchen-321588.html?group=3020165&pgpkl=cad489c2d189d388b31a2206fd609664' do
|
17
|
+
host, pk = ProductSpy.parse('http://www.baby-walz.de/Rassel-Soeckchen-321588.html?group=3020165&pgpkl=cad489c2d189d388b31a2206fd609664')
|
18
|
+
host.should == 'www.baby-walz.de'
|
19
|
+
pk.should == ['Rassel-Soeckchen-321588']
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
context 'build url' do
|
24
|
+
it 'returns: https://www.baby-walz.de/Rassel-Soeckchen-321588.html' do
|
25
|
+
ProductSpy.build('www.baby-walz.de', ['Rassel-Soeckchen-321588']).should == 'https://www.baby-walz.de/Rassel-Soeckchen-321588.html'
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
data/spec/ebay_spec.rb
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
describe ProductSpy, 'ebay' do
|
3
|
+
context 'parse url' do
|
4
|
+
it 'parses: http://www.ebay.de/itm/390542152250' do
|
5
|
+
host, pk = ProductSpy.parse('http://www.ebay.de/itm/390542152250')
|
6
|
+
host.should == 'www.ebay.de'
|
7
|
+
pk.should == ['390542152250']
|
8
|
+
end
|
9
|
+
|
10
|
+
it 'parses: https://www.ebay.de/itm/390542152250' do
|
11
|
+
host, pk = ProductSpy.parse('https://www.ebay.de/itm/390542152250')
|
12
|
+
host.should == 'www.ebay.de'
|
13
|
+
pk.should == ['390542152250']
|
14
|
+
end
|
15
|
+
|
16
|
+
it 'parses: http://www.ebay.de/itm/Inspirierende-Ferienhauser-/390542152250?pt=Sach_Fachb%C3%BCcher&hash=item5aee20523a#ht_500wt_948' do
|
17
|
+
host, pk = ProductSpy.parse('http://www.ebay.de/itm/Inspirierende-Ferienhauser-/390542152250?pt=Sach_Fachb%C3%BCcher&hash=item5aee20523a#ht_500wt_948')
|
18
|
+
host.should == 'www.ebay.de'
|
19
|
+
pk.should == ['390542152250']
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
context 'build url' do
|
24
|
+
it 'returns: https://www.ebay.de/itm/390542152250' do
|
25
|
+
ProductSpy.build('www.ebay.de', ['390542152250']).should == 'https://www.ebay.de/itm/390542152250'
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
@@ -0,0 +1,28 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
describe ProductSpy, 'hornbach.de' do
|
3
|
+
context 'parse url' do
|
4
|
+
it 'parses: https://www.hornbach.de/shop/HORNBACH-Projektbuch/7395450/artikel.html' do
|
5
|
+
host, pk = ProductSpy.parse('https://www.hornbach.de/shop/HORNBACH-Projektbuch/7395450/artikel.html')
|
6
|
+
host.should == 'www.hornbach.de'
|
7
|
+
pk.should == ['HORNBACH-Projektbuch', '7395450']
|
8
|
+
end
|
9
|
+
|
10
|
+
it 'parses: http://www.hornbach.de/shop/HORNBACH-Projektbuch/7395450/artikel.html' do
|
11
|
+
host, pk = ProductSpy.parse('http://www.hornbach.de/shop/HORNBACH-Projektbuch/7395450/artikel.html')
|
12
|
+
host.should == 'www.hornbach.de'
|
13
|
+
pk.should == ['HORNBACH-Projektbuch', '7395450']
|
14
|
+
end
|
15
|
+
|
16
|
+
it 'parses: http://www.hornbach.de/shop/HORNBACH-Projektbuch/7395450/artikel.html?sourceCat=S1405&WT.svl=artikel_text' do
|
17
|
+
host, pk = ProductSpy.parse('http://www.hornbach.de/shop/HORNBACH-Projektbuch/7395450/artikel.html?sourceCat=S1405&WT.svl=artikel_text')
|
18
|
+
host.should == 'www.hornbach.de'
|
19
|
+
pk.should == ['HORNBACH-Projektbuch', '7395450']
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
context 'build url' do
|
24
|
+
it 'returns: https://www.hornbach.de/shop/HORNBACH-Projektbuch/7395450/artikel.html' do
|
25
|
+
ProductSpy.build('www.hornbach.de', ['HORNBACH-Projektbuch', '7395450']).should == 'https://www.hornbach.de/shop/HORNBACH-Projektbuch/7395450/artikel.html'
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
describe ProductSpy, 'lecreuset.de' do
|
3
|
+
context 'parse url' do
|
4
|
+
it 'parses: https://www.lecreuset.de/Produkte-/Gusseisen/Klassische-Brater/Brater-Tradition-rund-24cm/' do
|
5
|
+
host, pk = ProductSpy.parse('https://www.lecreuset.de/Produkte-/Gusseisen/Klassische-Brater/Brater-Tradition-rund-24cm/')
|
6
|
+
host.should == 'www.lecreuset.de'
|
7
|
+
pk.should == ['Gusseisen/Klassische-Brater/Brater-Tradition-rund-24cm']
|
8
|
+
end
|
9
|
+
|
10
|
+
it 'parses: http://www.lecreuset.de/Produkte-/Gusseisen/Klassische-Brater/Brater-Tradition-rund-24cm/' do
|
11
|
+
host, pk = ProductSpy.parse('http://www.lecreuset.de/Produkte-/Gusseisen/Klassische-Brater/Brater-Tradition-rund-24cm/')
|
12
|
+
host.should == 'www.lecreuset.de'
|
13
|
+
pk.should == ['Gusseisen/Klassische-Brater/Brater-Tradition-rund-24cm']
|
14
|
+
end
|
15
|
+
|
16
|
+
it 'parses: http://www.lecreuset.de/Produkte-/Gusseisen/Klassische-Brater/Brater-Tradition-rund-24cm' do
|
17
|
+
host, pk = ProductSpy.parse('http://www.lecreuset.de/Produkte-/Gusseisen/Klassische-Brater/Brater-Tradition-rund-24cm')
|
18
|
+
host.should == 'www.lecreuset.de'
|
19
|
+
pk.should == ['Gusseisen/Klassische-Brater/Brater-Tradition-rund-24cm']
|
20
|
+
end
|
21
|
+
|
22
|
+
it 'parses: http://www.lecreuset.de/Produkte-/Gusseisen/Klassische-Brater/Brater-Tradition-rund-24cm/?x=y' do
|
23
|
+
host, pk = ProductSpy.parse('http://www.lecreuset.de/Produkte-/Gusseisen/Klassische-Brater/Brater-Tradition-rund-24cm/?x=y')
|
24
|
+
host.should == 'www.lecreuset.de'
|
25
|
+
pk.should == ['Gusseisen/Klassische-Brater/Brater-Tradition-rund-24cm']
|
26
|
+
end
|
27
|
+
|
28
|
+
it 'parses: http://www.lecreuset.de/Produkte-/Gusseisen/Klassische-Brater/Brater-Tradition-rund-24cm?x=y' do
|
29
|
+
host, pk = ProductSpy.parse('http://www.lecreuset.de/Produkte-/Gusseisen/Klassische-Brater/Brater-Tradition-rund-24cm?x=y')
|
30
|
+
host.should == 'www.lecreuset.de'
|
31
|
+
pk.should == ['Gusseisen/Klassische-Brater/Brater-Tradition-rund-24cm']
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
context 'build url' do
|
36
|
+
it 'returns: http://www.lecreuset.de/Produkte-/Gusseisen/Klassische-Brater/Brater-Tradition-rund-24cm' do
|
37
|
+
ProductSpy.build('www.lecreuset.de', ['Gusseisen/Klassische-Brater/Brater-Tradition-rund-24cm']).should == 'http://www.lecreuset.de/Produkte-/Gusseisen/Klassische-Brater/Brater-Tradition-rund-24cm/'
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
describe ProductSpy, 'porzellanhandel24.de' do
|
3
|
+
context 'parse url' do
|
4
|
+
it 'parses: https://www.porzellanhandel24.de/villeroy-boch-royal-becher-mit-henkel/' do
|
5
|
+
host, pk = ProductSpy.parse('https://www.porzellanhandel24.de/villeroy-boch-royal-becher-mit-henkel/')
|
6
|
+
host.should == 'www.porzellanhandel24.de'
|
7
|
+
pk.should == ['villeroy-boch-royal-becher-mit-henkel']
|
8
|
+
end
|
9
|
+
|
10
|
+
it 'parses: http://www.porzellanhandel24.de/villeroy-boch-royal-becher-mit-henkel/' do
|
11
|
+
host, pk = ProductSpy.parse('http://www.porzellanhandel24.de/villeroy-boch-royal-becher-mit-henkel/')
|
12
|
+
host.should == 'www.porzellanhandel24.de'
|
13
|
+
pk.should == ['villeroy-boch-royal-becher-mit-henkel']
|
14
|
+
end
|
15
|
+
|
16
|
+
it 'parses: http://www.porzellanhandel24.de/villeroy-boch-royal-becher-mit-henkel' do
|
17
|
+
host, pk = ProductSpy.parse('http://www.porzellanhandel24.de/villeroy-boch-royal-becher-mit-henkel')
|
18
|
+
host.should == 'www.porzellanhandel24.de'
|
19
|
+
pk.should == ['villeroy-boch-royal-becher-mit-henkel']
|
20
|
+
end
|
21
|
+
|
22
|
+
it 'parses: http://www.porzellanhandel24.de/villeroy-boch-royal-becher-mit-henkel/?refID=froogle&gclid=CL7Z-K63zrQCFXHLtAodTVoA5w' do
|
23
|
+
host, pk = ProductSpy.parse('http://www.porzellanhandel24.de/villeroy-boch-royal-becher-mit-henkel/?refID=froogle&gclid=CL7Z-K63zrQCFXHLtAodTVoA5w')
|
24
|
+
host.should == 'www.porzellanhandel24.de'
|
25
|
+
pk.should == ['villeroy-boch-royal-becher-mit-henkel']
|
26
|
+
end
|
27
|
+
|
28
|
+
it 'parses: http://www.porzellanhandel24.de/villeroy-boch-royal-becher-mit-henkel?refID=froogle&gclid=CL7Z-K63zrQCFXHLtAodTVoA5w' do
|
29
|
+
host, pk = ProductSpy.parse('http://www.porzellanhandel24.de/villeroy-boch-royal-becher-mit-henkel?refID=froogle&gclid=CL7Z-K63zrQCFXHLtAodTVoA5w')
|
30
|
+
host.should == 'www.porzellanhandel24.de'
|
31
|
+
pk.should == ['villeroy-boch-royal-becher-mit-henkel']
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
context 'build url' do
|
36
|
+
it 'returns: https://www.porzellanhandel24.de/villeroy-boch-royal-becher-mit-henkel' do
|
37
|
+
ProductSpy.build('www.porzellanhandel24.de', ['villeroy-boch-royal-becher-mit-henkel']).should == 'https://www.porzellanhandel24.de/villeroy-boch-royal-becher-mit-henkel'
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: product_spy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -49,6 +49,13 @@ files:
|
|
49
49
|
- lib/product_spy/version.rb
|
50
50
|
- product_spy.gemspec
|
51
51
|
- spec/amazon_spec.rb
|
52
|
+
- spec/anzberg-shop.de_spec.rb
|
53
|
+
- spec/baby-markt_spec.rb
|
54
|
+
- spec/baby-walz.de_spec.rb
|
55
|
+
- spec/ebay_spec.rb
|
56
|
+
- spec/hornbach.de_spec.rb
|
57
|
+
- spec/lecreuset.de_spec.rb
|
58
|
+
- spec/porzellanhandel24.de_spec.rb
|
52
59
|
- spec/spec_helper.rb
|
53
60
|
homepage: https://github.com/spieker/product_spy
|
54
61
|
licenses: []
|
@@ -77,5 +84,12 @@ summary: ProductSpy is made for parsing product URLs, i.e. Amazon-URLs, to get t
|
|
77
84
|
product keys and creating product URLs based on these keys
|
78
85
|
test_files:
|
79
86
|
- spec/amazon_spec.rb
|
87
|
+
- spec/anzberg-shop.de_spec.rb
|
88
|
+
- spec/baby-markt_spec.rb
|
89
|
+
- spec/baby-walz.de_spec.rb
|
90
|
+
- spec/ebay_spec.rb
|
91
|
+
- spec/hornbach.de_spec.rb
|
92
|
+
- spec/lecreuset.de_spec.rb
|
93
|
+
- spec/porzellanhandel24.de_spec.rb
|
80
94
|
- spec/spec_helper.rb
|
81
95
|
has_rdoc:
|