deltago4 0.0.1 → 3.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/deltago4.rb +40 -22
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9974200333acf3a9f19df309f35959ba741db44fc2fb571aa3c56a5e82ba8672
|
4
|
+
data.tar.gz: b242188acfb6e17ac13cb82145e9372dec4a37b2d8337d9ef2b0f4c38aac2703
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cf14186885364690a511d885900672f2fd377829f66e7cc20baf978810588a65729946f383cf190670058e1a3cf6a6220abdee83734045761ef34ec302e7d47e
|
7
|
+
data.tar.gz: 6523b2124822d45e8e216a76d60fab30ddad1528c79cc254dd96e5474ed82c16d85c63cc370ddfe39adb5612e7e22e23703dc78d30033e26d4e11849fc964b70
|
data/lib/deltago4.rb
CHANGED
@@ -93,24 +93,33 @@ class Soonje
|
|
93
93
|
puts product_data2
|
94
94
|
puts url_memory
|
95
95
|
|
96
|
-
if
|
97
|
-
title = ''
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
96
|
+
if false
|
97
|
+
title = ' '
|
98
|
+
begin
|
99
|
+
if @title_setting1 == true
|
100
|
+
title = product_data2[0]['title'] + ' ' +title
|
101
|
+
end
|
102
102
|
|
103
|
-
|
104
|
-
|
105
|
-
|
103
|
+
if @keyword_setting1 == true
|
104
|
+
title = @search_text[0] + ' ' + title
|
105
|
+
end
|
106
106
|
|
107
|
-
|
108
|
-
|
109
|
-
|
107
|
+
if @change_text_setting1 == true
|
108
|
+
@change_memory1.each do |key,v|
|
109
|
+
title = (title+'_').split(key).join(v.shuffle[0])
|
110
|
+
end
|
110
111
|
end
|
112
|
+
rescue
|
113
|
+
|
111
114
|
end
|
112
115
|
else
|
113
|
-
|
116
|
+
begin
|
117
|
+
title = @title_file.shuffle[0]
|
118
|
+
rescue
|
119
|
+
title = ''
|
120
|
+
end
|
121
|
+
|
122
|
+
title = title.to_s
|
114
123
|
|
115
124
|
if @title_setting1 == true
|
116
125
|
title = product_data2[0]['title'] + ' ' +title
|
@@ -258,6 +267,8 @@ class Soonje
|
|
258
267
|
rescue
|
259
268
|
|
260
269
|
end
|
270
|
+
sleep(2)
|
271
|
+
|
261
272
|
File.open('./data/'+title+'/'+product[0]['productId'].to_s+'.html', 'w') do |f|
|
262
273
|
f.write(vv2)
|
263
274
|
end
|
@@ -319,14 +330,20 @@ class Soonje
|
|
319
330
|
http = HTTP.headers(head).post('https://datalab.naver.com/shoppingInsight/getKeywordRank.naver?timeUnit=date&cid='+code.to_s)
|
320
331
|
rescue => exception
|
321
332
|
puts exception
|
322
|
-
puts 'http error 10초후 재시도'
|
323
|
-
sleep(10)
|
324
|
-
retry
|
325
333
|
end
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
334
|
+
begin
|
335
|
+
data = JSON.parse(http.to_s)
|
336
|
+
keyword = Array.new
|
337
|
+
puts data
|
338
|
+
begin
|
339
|
+
data[-1]['ranks'].each do |i|
|
340
|
+
keyword << i['keyword']
|
341
|
+
end
|
342
|
+
rescue
|
343
|
+
|
344
|
+
end
|
345
|
+
rescue
|
346
|
+
|
330
347
|
end
|
331
348
|
p keyword
|
332
349
|
answer[key] = keyword
|
@@ -359,7 +376,8 @@ class Soonje
|
|
359
376
|
noko = Nokogiri::HTML(http.to_s)
|
360
377
|
for y in 1..15
|
361
378
|
begin
|
362
|
-
t = noko.xpath('//*[@id="
|
379
|
+
t = noko.xpath('//*[@id="main_pack"]/section[1]/div/ul/li['+y.to_s+']/div/div[3]/div/a[2]/div').text.to_s
|
380
|
+
|
363
381
|
rescue
|
364
382
|
t = ''
|
365
383
|
end
|
@@ -506,7 +524,7 @@ class Soonje
|
|
506
524
|
@where_search = 'goldbox'
|
507
525
|
@proxy_list = Array.new
|
508
526
|
@change_text_setting3 = false
|
509
|
-
@user_login_ok =
|
527
|
+
@user_login_ok = 1
|
510
528
|
@code_text = Array.new
|
511
529
|
|
512
530
|
|
metadata
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: deltago4
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
7
|
+
- soonje
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
date: 2018-04-28 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: File to Clipboard gem
|
14
|
-
email:
|
14
|
+
email: rnjsalwl123@gmail.com
|
15
15
|
executables: []
|
16
16
|
extensions: []
|
17
17
|
extra_rdoc_files: []
|
@@ -36,7 +36,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
36
36
|
- !ruby/object:Gem::Version
|
37
37
|
version: '0'
|
38
38
|
requirements: []
|
39
|
-
rubygems_version: 3.
|
39
|
+
rubygems_version: 3.4.10
|
40
40
|
signing_key:
|
41
41
|
specification_version: 4
|
42
42
|
summary: file to clipboard
|