soonje_3 4.0.9 → 4.0.22
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.
Potentially problematic release.
This version of soonje_3 might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/lib/soonje_3.rb +22 -10
- 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: 591e50893a2b1f7f72d99c4f42594517081b02de418d3620da33e15e66ae57b7
|
|
4
|
+
data.tar.gz: af209e1cd3827cae2d112d18c20eedd83799a9cd90edf3586eb491c49649a05f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 21d5e14742b939c1422d33e8c718c1f786eff11764fa9a67141b10796abe5dc062a90c5606d31346037859c2b865aa277ed5dbf41a777814bf008579e324e7ef
|
|
7
|
+
data.tar.gz: 6b9542226e8a53c42a367185327af288925e11bb702cd7fd52f263c6242fd7628363f4fd51419a31cfca124d4c0813918175f28aa2c5bc44262ca38d84593cee
|
data/lib/soonje_3.rb
CHANGED
|
@@ -12,6 +12,7 @@ require 'rest-client'
|
|
|
12
12
|
require 'open3'
|
|
13
13
|
require 'zlib'
|
|
14
14
|
require 'stringio'
|
|
15
|
+
require 'timeout'
|
|
15
16
|
|
|
16
17
|
class Wordpress
|
|
17
18
|
include Glimmer
|
|
@@ -110,13 +111,18 @@ class Wordpress
|
|
|
110
111
|
end
|
|
111
112
|
|
|
112
113
|
def get_naver_text(q)
|
|
113
|
-
@driver = Selenium::WebDriver.for :chrome
|
|
114
|
-
@driver.get('https://search.naver.com/search.naver?display=15&f=&filetype=0&page=3&query='+q.to_s+'&research_url=&sm=tab_pge&start=16&where=web')
|
|
115
|
-
|
|
114
|
+
# @driver = Selenium::WebDriver.for :chrome
|
|
115
|
+
# @driver.get('https://search.naver.com/search.naver?display=15&f=&filetype=0&page=3&query='+q.to_s+'&research_url=&sm=tab_pge&start=16&where=web')
|
|
116
|
+
http2 = HTTP.get('https://search.naver.com/search.naver?display=15&f=&filetype=0&page=3&query='+q.to_s+'&research_url=&sm=tab_pge&start=16&where=web')
|
|
117
|
+
puts('http html get sleep 5...')
|
|
118
|
+
sleep(5)
|
|
119
|
+
noko = Nokogiri::HTML(http2.to_s)
|
|
116
120
|
tt = noko.xpath('//*[@id="main_pack"]/section/div/ul').text
|
|
117
121
|
for page in 3..8
|
|
118
|
-
@driver.get('https://www.google.com/search?q='+q.to_s+'&start='+(page*10).to_s)
|
|
119
|
-
|
|
122
|
+
# @driver.get('https://www.google.com/search?q='+q.to_s+'&start='+(page*10).to_s)
|
|
123
|
+
http3 = HTTP.get('https://www.google.com/search?q='+q.to_s+'&start='+(page*10).to_s)
|
|
124
|
+
sleep(2)
|
|
125
|
+
noko = Nokogiri::HTML(http3.to_s)
|
|
120
126
|
for n in 1..15
|
|
121
127
|
tt2 = noko.xpath('//*[@id="rso"]/div['+n.to_s+']/div/div/div[2]/div').text
|
|
122
128
|
if tt2.length < 5
|
|
@@ -127,7 +133,7 @@ class Wordpress
|
|
|
127
133
|
end
|
|
128
134
|
end
|
|
129
135
|
end
|
|
130
|
-
@driver.close
|
|
136
|
+
# @driver.close
|
|
131
137
|
tt = tt.split(' ').shuffle.join(' ')[0..5000]
|
|
132
138
|
m = Array.new
|
|
133
139
|
for n in 0..19
|
|
@@ -573,9 +579,11 @@ class Wordpress
|
|
|
573
579
|
check_success = 0
|
|
574
580
|
@data['table'].each_with_index do |table,index|
|
|
575
581
|
begin
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
582
|
+
status_timeout = Timeout::timeout(180) do
|
|
583
|
+
begin
|
|
584
|
+
if black_users.include?(table[2].to_s)
|
|
585
|
+
next
|
|
586
|
+
end
|
|
579
587
|
if table[4].to_i > table[6].to_i
|
|
580
588
|
if @data['포스트설정']['테더링'].checked?
|
|
581
589
|
puts 'tedering ip change...'
|
|
@@ -678,7 +686,7 @@ class Wordpress
|
|
|
678
686
|
@data['table'].pop
|
|
679
687
|
login_check = login()
|
|
680
688
|
if login_check == 0
|
|
681
|
-
black_users << table[
|
|
689
|
+
black_users << table[2].to_s
|
|
682
690
|
next
|
|
683
691
|
end
|
|
684
692
|
|
|
@@ -1248,6 +1256,10 @@ class Wordpress
|
|
|
1248
1256
|
|
|
1249
1257
|
end
|
|
1250
1258
|
end
|
|
1259
|
+
end
|
|
1260
|
+
rescue
|
|
1261
|
+
puts '2시간 멈춤 방지...'
|
|
1262
|
+
end
|
|
1251
1263
|
end
|
|
1252
1264
|
|
|
1253
1265
|
if check_success == 0
|