deltago 0.0.5 → 0.1.9
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 +36 -44
- 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: bae913b44a575a3360a0eb9350064d361c73f30d25e663caa659522fbdd44114
|
4
|
+
data.tar.gz: f42f88ab6280f4898784f09778547ccff9cbcd3baf6a3c4ba8becabef37a8f72
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 687cfcb4df3af896a954b190cad36764f04dc77a237b8088f8c90862ec69a90b454330a67c9cd5be399ce98bb1bd96cb9e9ae136ff4d2bb3a8fbc912c3b86f9c
|
7
|
+
data.tar.gz: 543598ec3c52a807dc7d2cc3a0365d3c586bf218bdf1c0a15b32140a981da220c78f19098c60094cb14f6bc66a831d33c6786de7e65778d17c12d4ceca9a80ec
|
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]
|
@@ -84,6 +95,7 @@ class Soonje
|
|
84
95
|
|
85
96
|
if @title_file.length == 0
|
86
97
|
title = ''
|
98
|
+
|
87
99
|
if @title_setting1 == true
|
88
100
|
title = product_data2[0]['title'] + ' ' +title
|
89
101
|
end
|
@@ -145,15 +157,12 @@ class Soonje
|
|
145
157
|
end
|
146
158
|
|
147
159
|
if @point_product_name2
|
148
|
-
text_bottom = text_bottom.
|
160
|
+
text_bottom = text_bottom.split(@point_keyword22.text.force_encoding('utf-8')).join(product_data2[0]['title'].force_encoding('utf-8'))
|
149
161
|
end
|
150
162
|
end
|
151
163
|
|
152
164
|
add_text = ''
|
153
165
|
if @add_text_setting1
|
154
|
-
if search_text[0].to_s == ''
|
155
|
-
search_text = ['가방']
|
156
|
-
end
|
157
166
|
add_text = naver_text(@search_text[0])
|
158
167
|
end
|
159
168
|
|
@@ -207,7 +216,7 @@ class Soonje
|
|
207
216
|
vv2 += '<div style="text-align: center;" align="center"> </div><br>'
|
208
217
|
vv2 += '<div style="text-align: center;" align="center"> </div><br>'
|
209
218
|
vv2 += '<div style="text-align: center;" align="center"> </div><br>'
|
210
|
-
vv2 += '<div style="text-align: center;" align="center">'+text_top+'</div><br>'
|
219
|
+
vv2 += '<div style="text-align: center;" align="center">'+text_top.split("\n").join('<br>')+'</div><br>'
|
211
220
|
vv2 += '<div style="text-align: center;" align="center"> </div><br>'
|
212
221
|
vv2 += '<div style="text-align: center;" align="center"> </div><br>'
|
213
222
|
vv2 += '<div style="text-align: center;" align="center"> </div><br>'
|
@@ -217,7 +226,9 @@ class Soonje
|
|
217
226
|
if url_change_check
|
218
227
|
link_url = change_url(link_url)
|
219
228
|
end
|
220
|
-
|
229
|
+
|
230
|
+
vv = '<center><img style="text-align: center;" align="center" src="'+dd['image'].to_s.split('212x212').join('500x500')+'"></center>'
|
231
|
+
vv = vv+ '<p style="text-align: center;" align="center">'+dd['productId'].to_s+' => 파일사진위치</p>'
|
221
232
|
vv = vv+ '<div style="text-align: center;" align="center"><span style="font-size: 18pt;">'+dd['title']+'</span></div>'
|
222
233
|
vv = vv+ '<div style="text-align: center;" align="center"><span style="font-size: 18pt; color: #ff4b4b;">'+dd['salesPrice'].to_s+' 원</span></div>'
|
223
234
|
vv = vv+ '<div style="text-align: center;" align="center"><span style="font-size: 10pt;">무료배송</span></div>'
|
@@ -231,7 +242,7 @@ class Soonje
|
|
231
242
|
vv2 += '<div style="text-align: center;" align="center"> </div><br>'
|
232
243
|
vv2 += '<div style="text-align: center;" align="center"> </div><br>'
|
233
244
|
vv2 += '<div style="text-align: center;" align="center"> </div><br>'
|
234
|
-
vv2 += '<div style="text-align: center;" align="center">'+text_bottom+'</div><br>'
|
245
|
+
vv2 += '<div style="text-align: center;" align="center">'+text_bottom.split("\n").join('<br>')+'</div><br>'
|
235
246
|
|
236
247
|
hidden_text = '<canvas width="0" height="0"><table width="165" style="width: 124pt; border-collapse: collapse;" border="0" cellspacing="0" cellpadding="0"><tbody><tr height="22" style="height: 16.5pt;"><td width="165" height="22" style="width: 124pt; text-align: center; font-size: 8pt; vertical-align: bottom; white-space: nowrap;"> '
|
237
248
|
hidden_text2 = '<div id="ssp-bottom"></div></td></tr></tbody></table></canvas>'
|
@@ -243,11 +254,11 @@ class Soonje
|
|
243
254
|
end
|
244
255
|
|
245
256
|
begin
|
246
|
-
Dir.mkdir('./data/'+
|
257
|
+
Dir.mkdir('./data/'+title)
|
247
258
|
rescue
|
248
259
|
|
249
260
|
end
|
250
|
-
File.open('./data/'+
|
261
|
+
File.open('./data/'+title+'/'+product[0]['productId'].to_s+'.html', 'w') do |f|
|
251
262
|
f.write(vv2)
|
252
263
|
end
|
253
264
|
|
@@ -260,7 +271,7 @@ class Soonje
|
|
260
271
|
sleep(10)
|
261
272
|
retry
|
262
273
|
end
|
263
|
-
File.open('./data/'+
|
274
|
+
File.open('./data/'+title+'/'+dd['productId'].to_s+'.jpg', 'wb') do |f|
|
264
275
|
f.write(http_image.body)
|
265
276
|
end
|
266
277
|
end
|
@@ -366,7 +377,11 @@ class Soonje
|
|
366
377
|
end
|
367
378
|
|
368
379
|
for n in 0..100
|
369
|
-
|
380
|
+
begin
|
381
|
+
text3 += text1.shuffle[0..5].join(' ')+text2.shuffle[0]
|
382
|
+
rescue
|
383
|
+
|
384
|
+
end
|
370
385
|
end
|
371
386
|
|
372
387
|
max_text = rand(900)+600
|
@@ -380,7 +395,6 @@ class Soonje
|
|
380
395
|
json['mb_id'] = user_id.to_s
|
381
396
|
json['mb_password'] = user_pw.to_s
|
382
397
|
http = HTTP.post('http://marketingduo.co.kr/bbs/login_check.php', :form => json)
|
383
|
-
puts http.to_s
|
384
398
|
if http.to_s.length == 0
|
385
399
|
http = HTTP.get('http://marketingduo.co.kr/bbs/buyListManager7.php')
|
386
400
|
noko = Nokogiri::HTML(http.to_s)
|
@@ -683,7 +697,7 @@ class Soonje
|
|
683
697
|
@add_text_setting2 = json['@add_text_setting2']
|
684
698
|
@tt9.checked = @add_text_setting2
|
685
699
|
@tag_setting = json['@tag_setting']
|
686
|
-
|
700
|
+
#@tt10.checked = @tag_setting
|
687
701
|
rescue
|
688
702
|
|
689
703
|
end
|
@@ -749,7 +763,7 @@ class Soonje
|
|
749
763
|
end
|
750
764
|
}
|
751
765
|
|
752
|
-
label('
|
766
|
+
label('생성 딜레이'){
|
753
767
|
stretchy false
|
754
768
|
}
|
755
769
|
|
@@ -757,7 +771,7 @@ class Soonje
|
|
757
771
|
stretchy false
|
758
772
|
}
|
759
773
|
|
760
|
-
label('
|
774
|
+
label('생성 수량'){
|
761
775
|
stretchy false
|
762
776
|
}
|
763
777
|
|
@@ -765,7 +779,7 @@ class Soonje
|
|
765
779
|
stretchy false
|
766
780
|
}
|
767
781
|
|
768
|
-
button('자동
|
782
|
+
button('자동 생성 시작'){
|
769
783
|
stretchy false
|
770
784
|
on_clicked do
|
771
785
|
if @user_login_ok == 1
|
@@ -776,7 +790,7 @@ class Soonje
|
|
776
790
|
end
|
777
791
|
}
|
778
792
|
|
779
|
-
button('자동
|
793
|
+
button('자동 생성 정지'){
|
780
794
|
stretchy false
|
781
795
|
on_clicked do
|
782
796
|
stop()
|
@@ -1372,30 +1386,7 @@ class Soonje
|
|
1372
1386
|
stretchy false
|
1373
1387
|
}
|
1374
1388
|
|
1375
|
-
|
1376
|
-
horizontal_box{
|
1377
|
-
stretchy false
|
1378
|
-
label('★ 마무리 설정'){
|
1379
|
-
stretchy false
|
1380
|
-
}
|
1381
|
-
|
1382
|
-
@tt10 = checkbox('태그 자동 입력'){
|
1383
|
-
stretchy false
|
1384
|
-
on_toggled do |c|
|
1385
|
-
@tag_setting = c.checked?
|
1386
|
-
end
|
1387
|
-
}
|
1388
|
-
|
1389
|
-
#combobox{
|
1390
|
-
# stretchy false
|
1391
|
-
# items('전체공개', '이웃공개', '서로이웃공개' , '비공개')
|
1392
|
-
# selected(0)
|
1393
|
-
# on_selected do |c|
|
1394
|
-
# @open_option = c.selected
|
1395
|
-
# end
|
1396
|
-
#}
|
1397
|
-
}
|
1398
|
-
=end
|
1389
|
+
|
1399
1390
|
}
|
1400
1391
|
}
|
1401
1392
|
}
|
@@ -1470,7 +1461,8 @@ class Coupang
|
|
1470
1461
|
end
|
1471
1462
|
|
1472
1463
|
def get_product_data2(where)
|
1473
|
-
http = HTTP.cookies(@cookie).get('https://partners.coupang.com/api/v1/discovery/'+where+'?limit=20')
|
1464
|
+
http = HTTP.cookies(@cookie).get('https://partners.coupang.com/api/v1/discovery/'+where[0]+'?limit=20')
|
1465
|
+
puts http.to_s
|
1474
1466
|
data = JSON.parse(http.to_s)['data']['products']
|
1475
1467
|
puts data
|
1476
1468
|
return data
|