deltago 0.0.1 → 0.0.2
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/lib/deltago.rb +16 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b9fd7e74db326209118bb96cae2c1936dc71c1ac4b546cba7b2f085f4a006ac2
|
4
|
+
data.tar.gz: 36a65dced5e352fee1871cb3d8feceb8a15335dd9b09859ee4600c6dd45b04a6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bb1128f83b9b3cdbcb189fd9394c757af020458f1d9b9a9c827553d67074ca6d2d8bc7e6e9db261f3a371550eb6e0758a9f94d619aaabbfc7a7862e7bd88bbfd
|
7
|
+
data.tar.gz: 9bf06f7cd2e9f560a091124ad9047e11373f32d8b748b4ee9585738993f57b29c6ffa93a6787f115daf3e879e9ffb1ddd1bde142d2ab68d89a8a7d95178e20e8
|
data/lib/deltago.rb
CHANGED
@@ -44,6 +44,12 @@ class Soonje
|
|
44
44
|
end
|
45
45
|
if @update_type == 1
|
46
46
|
rand_search_memory = Array.new
|
47
|
+
if @update_keyword['랜덤'] == 1
|
48
|
+
['패션의류', '패션잡화', '화장품/미용', '디지털/가전', '출산/육아', '식품', '스포츠/레저', '역사/생활편의', '면세점', '도서'].each do |key|
|
49
|
+
@update_keyword[key] = 1
|
50
|
+
end
|
51
|
+
end
|
52
|
+
p @update_keyword
|
47
53
|
@naver_keyword.each do |key,v|
|
48
54
|
if @update_keyword[key] == 1
|
49
55
|
v.each do |i|
|
@@ -52,14 +58,19 @@ class Soonje
|
|
52
58
|
end
|
53
59
|
end
|
54
60
|
@search_text = rand_search_memory.shuffle
|
61
|
+
p @search_text
|
55
62
|
elsif @update_type == 2
|
56
|
-
@
|
63
|
+
if @where_search == 'random'
|
64
|
+
@search_text = ['goldbox', 'rocket-fresh', 'most-discounted', 'most-sold'].shuffle
|
65
|
+
else
|
66
|
+
@search_text = [@where_search]
|
67
|
+
end
|
57
68
|
elsif @update_type == 3
|
58
69
|
@search_text = @user_keyword.shuffle
|
59
70
|
end
|
60
71
|
|
61
72
|
if @update_type == 2
|
62
|
-
product_data = @coupang.get_product_data2(@
|
73
|
+
product_data = @coupang.get_product_data2(@search_text)
|
63
74
|
product_data2 = product_data.sample(counter7)
|
64
75
|
else
|
65
76
|
puts '검색중 ==> '+@search_text[0]
|
@@ -83,7 +94,7 @@ class Soonje
|
|
83
94
|
puts url_memory
|
84
95
|
|
85
96
|
if @title_file.length == 0
|
86
|
-
title = ''
|
97
|
+
title = '제목없음'
|
87
98
|
else
|
88
99
|
title = @title_file.shuffle[0]
|
89
100
|
|
@@ -1428,7 +1439,8 @@ class Coupang
|
|
1428
1439
|
end
|
1429
1440
|
|
1430
1441
|
def get_product_data2(where)
|
1431
|
-
http = HTTP.cookies(@cookie).get('https://partners.coupang.com/api/v1/discovery/'+where+'?limit=20')
|
1442
|
+
http = HTTP.cookies(@cookie).get('https://partners.coupang.com/api/v1/discovery/'+where[0]+'?limit=20')
|
1443
|
+
puts http.to_s
|
1432
1444
|
data = JSON.parse(http.to_s)['data']['products']
|
1433
1445
|
puts data
|
1434
1446
|
return data
|