stylemooncat 0.0.7 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/bin/stylemooncat +12 -1
- data/lib/stylemooncat/scraper.rb +4 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d22a25a0df1771109c5519e3bd76209381878a77
|
4
|
+
data.tar.gz: 21b0f00b49821cf758437aacdff9af2121663b9c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ac9206c21e680963f0fa251a499c776f47715668953ba428c8d8071d05c39091a1771edbd8e3f25914fe130c921f13b4e99bcac5544a226e601b86eacf32bc5f
|
7
|
+
data.tar.gz: c532ddf1a5d9a03be1e73e22ec1190a87a56853413d6ce63e7a96fe13d567426a0a0190d89cc4b4bf4a98bee0c8e672344902a67a386ffb48be51e0cb9229de5
|
data/bin/stylemooncat
CHANGED
@@ -3,5 +3,16 @@
|
|
3
3
|
require_relative '../lib/stylemooncat.rb'
|
4
4
|
|
5
5
|
@scraper = StyleMoonCat::Scraper.new
|
6
|
-
|
6
|
+
options ={}
|
7
|
+
options[:page_limit]=ARGV[1]
|
8
|
+
|
9
|
+
price_boundary=[]
|
10
|
+
price_boundary.push(ARGV[3])
|
11
|
+
price_boundary.push(ARGV[4])
|
12
|
+
|
13
|
+
options[:keyword]=ARGV[2]
|
14
|
+
options[:price_boundary]=price_boundary
|
15
|
+
|
16
|
+
#puts @scraper.scrape(ARGV[0],ARGV[1],ARGV[2],ARGV[3],ARGV[4],ARGV[5])
|
17
|
+
puts @scraper.scrape(ARGV[0],options)
|
7
18
|
#puts @scraper.scrape("shoes",{:keyword=>"none",:page_limit=>3,:price_boundary=>[0,600]})
|
data/lib/stylemooncat/scraper.rb
CHANGED
@@ -106,7 +106,7 @@ module StyleMoonCat
|
|
106
106
|
end
|
107
107
|
@filter_results=[]
|
108
108
|
@count=1
|
109
|
-
1.upto(page_limit) do
|
109
|
+
1.upto(page_limit.to_i) do
|
110
110
|
page = @count
|
111
111
|
case category
|
112
112
|
when "newarrival"
|
@@ -265,7 +265,9 @@ module StyleMoonCat
|
|
265
265
|
end
|
266
266
|
|
267
267
|
def extract_images(item)
|
268
|
-
|
268
|
+
result=[]
|
269
|
+
result.push(item.xpath(@@IMAGE_XPATH).attribute(:src).first.value)
|
270
|
+
|
269
271
|
end
|
270
272
|
|
271
273
|
def extract_link(item)
|