deltago4 0.0.1 → 4.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 +39 -21
- 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: c1e24fc3f24e34fb59aef872873e52961a64907ad31fcf17b824091219c42daf
|
4
|
+
data.tar.gz: 959139b0284aa162ebec0a8799d976590b63a78993aac6d88df8b7ab7593daa7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f9715cea2723c56e9156887f40df041a91946455b8b80f8ff9c2bdf84a75fd8d1296d63e24558e09b180ce3addae9b4a4f6d94c8be41cb2d75639356bfb5a376
|
7
|
+
data.tar.gz: 3363864cab1f2b5c21175bb7b7fc2e31537a10d49b48d4288cd5f1019a1a9328efd1ae8744fd9f5734421338e16b4da6bc06ec4d6f1d91eef6ce255d4364539a
|
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
|
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: 4.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
|