deltago 0.0.5 → 0.1.6
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 +32 -62
- 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: 9aa83d47c6a6d14bcd16e5f614bfaa0f82a16e97e95c29c1b50422ded900856d
|
4
|
+
data.tar.gz: 641f1e50a0eb641e8cddf4c0d7802bbe523e84bcc1f6a310b3032cbe11ea644a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 351c77e0e7703f2269ef49e2cd016d97241420e442623c9670849e072228308762f5d1e7dcf6ad60030b2cad6a22aa777fa6aabe565a38e9d92234a807dd1af8
|
7
|
+
data.tar.gz: 5b29534d8ec9928d2531898be0357bcaa245b0ad619fd1188cbdc1135642b10a48575569863909fdf23832ec0d9b1ac1d068b574a84923430133d5d4e35ab24d
|
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,7 @@ class Soonje
|
|
366
359
|
end
|
367
360
|
|
368
361
|
for n in 0..100
|
369
|
-
text3 += text1.shuffle[0..5].join(' ')+text2.shuffle[0]
|
362
|
+
text3 += text1.shuffle[0..5].join(' ')+text2.shuffle[0]
|
370
363
|
end
|
371
364
|
|
372
365
|
max_text = rand(900)+600
|
@@ -380,7 +373,6 @@ class Soonje
|
|
380
373
|
json['mb_id'] = user_id.to_s
|
381
374
|
json['mb_password'] = user_pw.to_s
|
382
375
|
http = HTTP.post('http://marketingduo.co.kr/bbs/login_check.php', :form => json)
|
383
|
-
puts http.to_s
|
384
376
|
if http.to_s.length == 0
|
385
377
|
http = HTTP.get('http://marketingduo.co.kr/bbs/buyListManager7.php')
|
386
378
|
noko = Nokogiri::HTML(http.to_s)
|
@@ -683,7 +675,7 @@ class Soonje
|
|
683
675
|
@add_text_setting2 = json['@add_text_setting2']
|
684
676
|
@tt9.checked = @add_text_setting2
|
685
677
|
@tag_setting = json['@tag_setting']
|
686
|
-
|
678
|
+
#@tt10.checked = @tag_setting
|
687
679
|
rescue
|
688
680
|
|
689
681
|
end
|
@@ -749,7 +741,7 @@ class Soonje
|
|
749
741
|
end
|
750
742
|
}
|
751
743
|
|
752
|
-
label('
|
744
|
+
label('생성 딜레이'){
|
753
745
|
stretchy false
|
754
746
|
}
|
755
747
|
|
@@ -757,7 +749,7 @@ class Soonje
|
|
757
749
|
stretchy false
|
758
750
|
}
|
759
751
|
|
760
|
-
label('
|
752
|
+
label('생성 수량'){
|
761
753
|
stretchy false
|
762
754
|
}
|
763
755
|
|
@@ -765,7 +757,7 @@ class Soonje
|
|
765
757
|
stretchy false
|
766
758
|
}
|
767
759
|
|
768
|
-
button('자동
|
760
|
+
button('자동 생성 시작'){
|
769
761
|
stretchy false
|
770
762
|
on_clicked do
|
771
763
|
if @user_login_ok == 1
|
@@ -776,7 +768,7 @@ class Soonje
|
|
776
768
|
end
|
777
769
|
}
|
778
770
|
|
779
|
-
button('자동
|
771
|
+
button('자동 생성 정지'){
|
780
772
|
stretchy false
|
781
773
|
on_clicked do
|
782
774
|
stop()
|
@@ -1372,30 +1364,7 @@ class Soonje
|
|
1372
1364
|
stretchy false
|
1373
1365
|
}
|
1374
1366
|
|
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
|
1367
|
+
|
1399
1368
|
}
|
1400
1369
|
}
|
1401
1370
|
}
|
@@ -1470,7 +1439,8 @@ class Coupang
|
|
1470
1439
|
end
|
1471
1440
|
|
1472
1441
|
def get_product_data2(where)
|
1473
|
-
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
|
1474
1444
|
data = JSON.parse(http.to_s)['data']['products']
|
1475
1445
|
puts data
|
1476
1446
|
return data
|