deltago 0.0.4 → 0.1.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/lib/deltago.rb +36 -60
- 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: 4c8907f8d2b1d6836c0912273138406d39554d4e718c2b934a13bfb5d1b0a569
|
4
|
+
data.tar.gz: 29fa209f53a150f8ccfdc365a2589f3d16e5e5856d178706a144c7813cc62de6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1bd6df9c7f8fe578f53ef6e979a21168a0ffc31e5d5ca574b16c43ddaa0cb315ddc2eb3f0e9131b35477ea193007b2384c461689aefa6fb15df9ec11b3a5e5bd
|
7
|
+
data.tar.gz: 4cc7b43a28b917633af3c069806e4f057f3a7f04ef74296308ffacc5c5571a4dcc56400eff7822f1d62863626f3680924f25aeafe49322e0efbd7277e959e102
|
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,20 +94,7 @@ class Soonje
|
|
83
94
|
puts url_memory
|
84
95
|
|
85
96
|
if @title_file.length == 0
|
86
|
-
title = ''
|
87
|
-
if @title_setting1 == true
|
88
|
-
title = product_data2[0]['title'] + ' ' +title
|
89
|
-
end
|
90
|
-
|
91
|
-
if @keyword_setting1 == true
|
92
|
-
title = @search_text[0] + ' ' + title
|
93
|
-
end
|
94
|
-
|
95
|
-
if @change_text_setting1 == true
|
96
|
-
@change_memory1.each do |key,v|
|
97
|
-
title = (title+'_').split(key).join(v.shuffle[0])
|
98
|
-
end
|
99
|
-
end
|
97
|
+
title = '제목없음'
|
100
98
|
else
|
101
99
|
title = @title_file.shuffle[0]
|
102
100
|
|
@@ -145,15 +143,12 @@ class Soonje
|
|
145
143
|
end
|
146
144
|
|
147
145
|
if @point_product_name2
|
148
|
-
text_bottom = text_bottom.
|
146
|
+
text_bottom = text_bottom.split(@point_keyword22.text.force_encoding('utf-8')).join(product_data2[0]['title'].force_encoding('utf-8'))
|
149
147
|
end
|
150
148
|
end
|
151
149
|
|
152
150
|
add_text = ''
|
153
151
|
if @add_text_setting1
|
154
|
-
if search_text[0].to_s == ''
|
155
|
-
search_text = ['가방']
|
156
|
-
end
|
157
152
|
add_text = naver_text(@search_text[0])
|
158
153
|
end
|
159
154
|
|
@@ -207,7 +202,7 @@ class Soonje
|
|
207
202
|
vv2 += '<div style="text-align: center;" align="center"> </div><br>'
|
208
203
|
vv2 += '<div style="text-align: center;" align="center"> </div><br>'
|
209
204
|
vv2 += '<div style="text-align: center;" align="center"> </div><br>'
|
210
|
-
vv2 += '<div style="text-align: center;" align="center">'+text_top+'</div><br>'
|
205
|
+
vv2 += '<div style="text-align: center;" align="center">'+text_top.split("\n").join('<br>')+'</div><br>'
|
211
206
|
vv2 += '<div style="text-align: center;" align="center"> </div><br>'
|
212
207
|
vv2 += '<div style="text-align: center;" align="center"> </div><br>'
|
213
208
|
vv2 += '<div style="text-align: center;" align="center"> </div><br>'
|
@@ -217,7 +212,9 @@ class Soonje
|
|
217
212
|
if url_change_check
|
218
213
|
link_url = change_url(link_url)
|
219
214
|
end
|
220
|
-
|
215
|
+
|
216
|
+
vv = '<center><img style="text-align: center;" align="center" src="'+dd['image'].to_s.split('212x212').join('500x500')+'"></center>'
|
217
|
+
vv = vv+ '<p style="text-align: center;" align="center">'+dd['productId'].to_s+' => 파일사진위치</p>'
|
221
218
|
vv = vv+ '<div style="text-align: center;" align="center"><span style="font-size: 18pt;">'+dd['title']+'</span></div>'
|
222
219
|
vv = vv+ '<div style="text-align: center;" align="center"><span style="font-size: 18pt; color: #ff4b4b;">'+dd['salesPrice'].to_s+' 원</span></div>'
|
223
220
|
vv = vv+ '<div style="text-align: center;" align="center"><span style="font-size: 10pt;">무료배송</span></div>'
|
@@ -231,7 +228,7 @@ class Soonje
|
|
231
228
|
vv2 += '<div style="text-align: center;" align="center"> </div><br>'
|
232
229
|
vv2 += '<div style="text-align: center;" align="center"> </div><br>'
|
233
230
|
vv2 += '<div style="text-align: center;" align="center"> </div><br>'
|
234
|
-
vv2 += '<div style="text-align: center;" align="center">'+text_bottom+'</div><br>'
|
231
|
+
vv2 += '<div style="text-align: center;" align="center">'+text_bottom.split("\n").join('<br>')+'</div><br>'
|
235
232
|
|
236
233
|
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
234
|
hidden_text2 = '<div id="ssp-bottom"></div></td></tr></tbody></table></canvas>'
|
@@ -242,12 +239,8 @@ class Soonje
|
|
242
239
|
vv2 += '<div style="text-align: center;" align="center">'+add_text+'</div><br>'
|
243
240
|
end
|
244
241
|
|
245
|
-
|
246
|
-
|
247
|
-
rescue
|
248
|
-
|
249
|
-
end
|
250
|
-
File.open('./data/'+product[0]['productId'].to_s+'/'+product[0]['productId'].to_s+'.html', 'w') do |f|
|
242
|
+
Dir.mkdir('./data/'+title)
|
243
|
+
File.open('./data/'+title+'/'+product[0]['productId'].to_s+'.html', 'w') do |f|
|
251
244
|
f.write(vv2)
|
252
245
|
end
|
253
246
|
|
@@ -260,7 +253,7 @@ class Soonje
|
|
260
253
|
sleep(10)
|
261
254
|
retry
|
262
255
|
end
|
263
|
-
File.open('./data/'+
|
256
|
+
File.open('./data/'+title+'/'+dd['productId'].to_s+'.jpg', 'wb') do |f|
|
264
257
|
f.write(http_image.body)
|
265
258
|
end
|
266
259
|
end
|
@@ -366,7 +359,11 @@ class Soonje
|
|
366
359
|
end
|
367
360
|
|
368
361
|
for n in 0..100
|
369
|
-
|
362
|
+
begin
|
363
|
+
text3 += text1.shuffle[0..5].join(' ')+text2.shuffle[0]
|
364
|
+
rescue
|
365
|
+
|
366
|
+
end
|
370
367
|
end
|
371
368
|
|
372
369
|
max_text = rand(900)+600
|
@@ -380,7 +377,6 @@ class Soonje
|
|
380
377
|
json['mb_id'] = user_id.to_s
|
381
378
|
json['mb_password'] = user_pw.to_s
|
382
379
|
http = HTTP.post('http://marketingduo.co.kr/bbs/login_check.php', :form => json)
|
383
|
-
puts http.to_s
|
384
380
|
if http.to_s.length == 0
|
385
381
|
http = HTTP.get('http://marketingduo.co.kr/bbs/buyListManager7.php')
|
386
382
|
noko = Nokogiri::HTML(http.to_s)
|
@@ -683,7 +679,7 @@ class Soonje
|
|
683
679
|
@add_text_setting2 = json['@add_text_setting2']
|
684
680
|
@tt9.checked = @add_text_setting2
|
685
681
|
@tag_setting = json['@tag_setting']
|
686
|
-
|
682
|
+
#@tt10.checked = @tag_setting
|
687
683
|
rescue
|
688
684
|
|
689
685
|
end
|
@@ -749,7 +745,7 @@ class Soonje
|
|
749
745
|
end
|
750
746
|
}
|
751
747
|
|
752
|
-
label('
|
748
|
+
label('생성 딜레이'){
|
753
749
|
stretchy false
|
754
750
|
}
|
755
751
|
|
@@ -757,7 +753,7 @@ class Soonje
|
|
757
753
|
stretchy false
|
758
754
|
}
|
759
755
|
|
760
|
-
label('
|
756
|
+
label('생성 수량'){
|
761
757
|
stretchy false
|
762
758
|
}
|
763
759
|
|
@@ -765,7 +761,7 @@ class Soonje
|
|
765
761
|
stretchy false
|
766
762
|
}
|
767
763
|
|
768
|
-
button('자동
|
764
|
+
button('자동 생성 시작'){
|
769
765
|
stretchy false
|
770
766
|
on_clicked do
|
771
767
|
if @user_login_ok == 1
|
@@ -776,7 +772,7 @@ class Soonje
|
|
776
772
|
end
|
777
773
|
}
|
778
774
|
|
779
|
-
button('자동
|
775
|
+
button('자동 생성 정지'){
|
780
776
|
stretchy false
|
781
777
|
on_clicked do
|
782
778
|
stop()
|
@@ -1372,28 +1368,7 @@ class Soonje
|
|
1372
1368
|
stretchy false
|
1373
1369
|
}
|
1374
1370
|
|
1375
|
-
|
1376
|
-
stretchy false
|
1377
|
-
label('★ 마무리 설정'){
|
1378
|
-
stretchy false
|
1379
|
-
}
|
1380
|
-
|
1381
|
-
@tt10 = checkbox('태그 자동 입력'){
|
1382
|
-
stretchy false
|
1383
|
-
on_toggled do |c|
|
1384
|
-
@tag_setting = c.checked?
|
1385
|
-
end
|
1386
|
-
}
|
1387
|
-
|
1388
|
-
#combobox{
|
1389
|
-
# stretchy false
|
1390
|
-
# items('전체공개', '이웃공개', '서로이웃공개' , '비공개')
|
1391
|
-
# selected(0)
|
1392
|
-
# on_selected do |c|
|
1393
|
-
# @open_option = c.selected
|
1394
|
-
# end
|
1395
|
-
#}
|
1396
|
-
}
|
1371
|
+
|
1397
1372
|
}
|
1398
1373
|
}
|
1399
1374
|
}
|
@@ -1468,7 +1443,8 @@ class Coupang
|
|
1468
1443
|
end
|
1469
1444
|
|
1470
1445
|
def get_product_data2(where)
|
1471
|
-
http = HTTP.cookies(@cookie).get('https://partners.coupang.com/api/v1/discovery/'+where+'?limit=20')
|
1446
|
+
http = HTTP.cookies(@cookie).get('https://partners.coupang.com/api/v1/discovery/'+where[0]+'?limit=20')
|
1447
|
+
puts http.to_s
|
1472
1448
|
data = JSON.parse(http.to_s)['data']['products']
|
1473
1449
|
puts data
|
1474
1450
|
return data
|