soonje_3 4.0.22 → 4.0.27

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/soonje_3.rb +189 -61
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 591e50893a2b1f7f72d99c4f42594517081b02de418d3620da33e15e66ae57b7
4
- data.tar.gz: af209e1cd3827cae2d112d18c20eedd83799a9cd90edf3586eb491c49649a05f
3
+ metadata.gz: b4bd9e6e6114abadadae202baa50e8fdb2f40628fbff4d650e49120ab58df74f
4
+ data.tar.gz: a9b4f57a34a67bfdc41aa83638ed611f795fd05442e6371891fc9afdd469c31a
5
5
  SHA512:
6
- metadata.gz: 21d5e14742b939c1422d33e8c718c1f786eff11764fa9a67141b10796abe5dc062a90c5606d31346037859c2b865aa277ed5dbf41a777814bf008579e324e7ef
7
- data.tar.gz: 6b9542226e8a53c42a367185327af288925e11bb702cd7fd52f263c6242fd7628363f4fd51419a31cfca124d4c0813918175f28aa2c5bc44262ca38d84593cee
6
+ metadata.gz: 6c4233ac29eb31c1e16488254df91acd65173b402297d2ed3f74e8cd71e9968a3355c12d38db4f7ac56e49c9ee9d06a8bd02442e4bd14fa04f75f8927d4ca822
7
+ data.tar.gz: fc73aef4a079fd6c331b426d3d41d2cb547bff06adc1115b20a2d9918278e64aece0f516d522a25170f58261d06d5deffa9929adc8c47d928b78c9a19aa7bce2
data/lib/soonje_3.rb CHANGED
@@ -1,6 +1,4 @@
1
1
  require 'glimmer-dsl-libui'
2
- require 'selenium-webdriver'
3
- require 'webdrivers'
4
2
  require 'nokogiri'
5
3
  require 'http'
6
4
  require 'nokogiri'
@@ -34,7 +32,7 @@ class Wordpress
34
32
  if mac_check(user_id) == 1
35
33
  return 1
36
34
  else
37
- return 1
35
+ return 44
38
36
  end
39
37
  else
40
38
  return 22
@@ -110,36 +108,97 @@ class Wordpress
110
108
  end
111
109
  end
112
110
 
113
- def get_naver_text(q)
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)
120
- tt = noko.xpath('//*[@id="main_pack"]/section/div/ul').text
121
- for page in 3..8
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)
126
- for n in 1..15
127
- tt2 = noko.xpath('//*[@id="rso"]/div['+n.to_s+']/div/div/div[2]/div').text
128
- if tt2.length < 5
111
+ # def get_naver_text(q)
112
+ # begin
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
+ # 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')
116
+ # puts('http html get sleep 5...')
117
+ # sleep(5)
118
+ # noko = Nokogiri::HTML(http2.to_s)
119
+ # tt = noko.xpath('//*[@id="main_pack"]/section/div/ul').text
120
+ # for page in 3..8
121
+ # # @driver.get('https://www.google.com/search?q='+q.to_s+'&start='+(page*10).to_s)
122
+ # http3 = HTTP.get('https://www.google.com/search?q='+q.to_s+'&start='+(page*10).to_s)
123
+ # sleep(2)
124
+ # noko = Nokogiri::HTML(http3.to_s)
125
+ # for n in 1..15
126
+ # tt2 = noko.xpath('//*[@id="rso"]/div['+n.to_s+']/div/div/div[2]/div').text
127
+ # if tt2.length < 5
128
+
129
+ # else
130
+ # tt2 = tt2.split('...').join('')
131
+ # tt += tt2
132
+ # end
133
+ # end
134
+ # end
135
+ # # @driver.close
136
+ # tt = tt.split(' ').shuffle.join(' ')[0..5000]
137
+ # m = Array.new
138
+ # for n in 0..19
139
+ # m << tt[(n*100)..(n*100+100)]
140
+ # end
141
+ # return m.join("\n")
142
+ # rescue
143
+ # puts('naver_text error 재시도 ...')
144
+ # sleep(3)
145
+ # retry
146
+ # end
147
+ # end
129
148
 
130
- else
131
- tt2 = tt2.split('...').join('')
132
- tt += tt2
149
+ def get_naver_text(q)
150
+ text_array = Array.new
151
+ for page in 1..7
152
+ begin
153
+ http = HTTP.get('https://search.zum.com/search.zum?method=blog&option=accu&query='+q.to_s+'&rd=1&page='+page.to_s+'&mm=direct')
154
+ sleep(1)
155
+ noko = Nokogiri::HTML(http.to_s)
156
+ for n in 1..10
157
+ begin
158
+ text_array << noko.xpath('//*[@id="blogItemUl"]/li['+n.to_s+']/dl/dd[2]').text.split('...').join('')
159
+ rescue
160
+
161
+ end
133
162
  end
163
+ rescue
164
+ puts 'zum 검색 http error ...'
134
165
  end
135
166
  end
136
- # @driver.close
137
- tt = tt.split(' ').shuffle.join(' ')[0..5000]
138
- m = Array.new
139
- for n in 0..19
140
- m << tt[(n*100)..(n*100+100)]
167
+
168
+ for page in 2..7
169
+ begin
170
+ http = HTTP.get('https://search.daum.net/search?w=blog&DA=PGD&enc=utf8&q='+q.to_s.split(' ').join('')+'&p='+page.to_s)
171
+ sleep(1)
172
+ noko = Nokogiri::HTML(http.to_s)
173
+ puts http.to_s
174
+ puts 'daum ok ...'
175
+ giri = noko.xpath('//*[@id="blogColl"]/div[3]/ul').to_s
176
+ daum_blog_id = Array.new
177
+ for n in giri.split('<li')[1..-1]
178
+ begin
179
+ daum_blog_id << n.split('id="')[1].split('"')[0]
180
+ rescue
181
+
182
+ end
183
+ end
184
+ p daum_blog_id
185
+
186
+ for blog_id in daum_blog_id
187
+ begin
188
+ v = noko.xpath('//*[@id="'+blog_id.to_s+'"]/div[2]/div/p').text
189
+ if v != ''
190
+ text_array << v.split('...').join('')
191
+ end
192
+ rescue
193
+
194
+ end
195
+ end
196
+ rescue
197
+
198
+ end
141
199
  end
142
- return m.join("\n")
200
+
201
+ return text_array.uniq.shuffle.join("\n")[0..5000]
143
202
  end
144
203
 
145
204
  def chrome_start(url, user_id, user_pw)
@@ -581,8 +640,8 @@ class Wordpress
581
640
  begin
582
641
  status_timeout = Timeout::timeout(180) do
583
642
  begin
584
- if black_users.include?(table[2].to_s)
585
- next
643
+ if black_users.include?(table[1].to_s + table[2].to_s)
644
+ next
586
645
  end
587
646
  if table[4].to_i > table[6].to_i
588
647
  if @data['포스트설정']['테더링'].checked?
@@ -686,7 +745,7 @@ class Wordpress
686
745
  @data['table'].pop
687
746
  login_check = login()
688
747
  if login_check == 0
689
- black_users << table[2].to_s
748
+ black_users << table[1].to_s + table[2].to_s
690
749
  next
691
750
  end
692
751
 
@@ -880,7 +939,14 @@ class Wordpress
880
939
  if @data['포스트설정']['내용과자동생성'].checked?
881
940
  content22 = content.split("(자동생성글)")[1].split("\n")
882
941
  else
883
- content22 = content.split("\n")
942
+ if @data['포스트설정']['내용과자동생성'].checked? == false and @data['포스트설정']['내용을자동생성'].checked? == false and @data['포스트설정']['막글삽입'].checked? == true
943
+ snumber = @data['포스트설정']['막글삽입시작숫자'].text.to_s.to_i
944
+ enumber = @data['포스트설정']['막글삽입끝숫자'].text.to_s.to_i
945
+ last_text = @data['포스트설정']['막글'][0..rand(snumber..enumber)].split(' ').shuffle.join(' ')
946
+ content22 = last_text.split(' ')
947
+ else
948
+ content22 = content.split("\n")
949
+ end
884
950
  end
885
951
  position_point = rand(0..(content22.length-2))
886
952
  if position.include?(position_point)
@@ -910,19 +976,19 @@ class Wordpress
910
976
  content2 = content.split("\n")
911
977
  end
912
978
 
913
- while true
914
- check10 = 0
915
- for nn in 0..position.length-1
916
- if content2[position[nn]].to_s.include?('style') or content[position[nn]].to_s.include?('<') or content[position[nn]].to_s.include?('>')
917
- check10 = 1
918
- position[nn] += 1
919
- end
920
- end
921
- puts 'check10 => '+check10.to_s
922
- if check10 == 0
923
- break
924
- end
925
- end
979
+ # while true
980
+ # check10 = 0
981
+ # for nn in 0..position.length-1
982
+ # if content2[position[nn]].to_s.include?('style') or content[position[nn]].to_s.include?('<') or content[position[nn]].to_s.include?('>')
983
+ # check10 = 1
984
+ # position[nn] += 1
985
+ # end
986
+ # end
987
+ # puts 'check10 => '+check10.to_s
988
+ # if check10 == 0
989
+ # break
990
+ # end
991
+ # end
926
992
 
927
993
 
928
994
  content3 = Array.new
@@ -970,20 +1036,48 @@ class Wordpress
970
1036
  end
971
1037
 
972
1038
  if @data['포스트설정']['내용과자동생성'].checked? == false and @data['포스트설정']['내용을자동생성'].checked? == false
973
- content2.each_with_index do |con, index|
974
- if position.include?(index)
975
- insert_keyword_text = keyword.to_s
976
- if @data['포스트설정']['키워드삽입'].checked?
977
- insert_keyword_text = ' <a href="'+@data['포스트설정']['키워드삽입시링크'].text.to_s+'" title="'+keyword.to_s+'">'+insert_keyword_text.to_s+'</a> '
1039
+ if @data['포스트설정']['내용과자동생성'].checked? == false and @data['포스트설정']['내용을자동생성'].checked? == false
1040
+ if @data['포스트설정']['막글삽입'].checked?
1041
+ position2 = Array.new
1042
+ position3 = Array.new
1043
+ position.each_with_index do |pv, index|
1044
+ position3 << pv
978
1045
  end
979
- con2 = con.split('')
980
- content3 << con2.join('')
981
- content3 << insert_keyword_text
1046
+
1047
+ p position2
1048
+ p position3
1049
+
1050
+ content2.each_with_index do |con, index|
1051
+ if position2.include?(index)
1052
+ insert_keyword_text = keyword.to_s
1053
+ if @data['포스트설정']['키워드삽입'].checked?
1054
+ insert_keyword_text = ' <a href="'+@data['포스트설정']['키워드삽입시링크'].text.to_s+'" title="'+keyword.to_s+'">'+insert_keyword_text.to_s+'</a> '
1055
+ end
1056
+ con2 = con.split('')
1057
+ content3 << con2.join('')
1058
+ content3 << insert_keyword_text
1059
+ else
1060
+ content3 << con
1061
+ end
1062
+ end
1063
+ content = content3.join("\n")
982
1064
  else
983
- content3 << con
1065
+ content2.each_with_index do |con, index|
1066
+ if position.include?(index)
1067
+ insert_keyword_text = keyword.to_s
1068
+ if @data['포스트설정']['키워드삽입'].checked?
1069
+ insert_keyword_text = ' <a href="'+@data['포스트설정']['키워드삽입시링크'].text.to_s+'" title="'+keyword.to_s+'">'+insert_keyword_text.to_s+'</a> '
1070
+ end
1071
+ con2 = con.split('')
1072
+ content3 << con2.join('')
1073
+ content3 << insert_keyword_text
1074
+ else
1075
+ content3 << con
1076
+ end
1077
+ end
1078
+ content = content3.join("\n")
984
1079
  end
985
1080
  end
986
- content = content3.join("\n")
987
1081
  end
988
1082
  end
989
1083
 
@@ -1167,12 +1261,44 @@ class Wordpress
1167
1261
  content = content+"\n\n"+content_end
1168
1262
 
1169
1263
  if @data['포스트설정']['막글삽입'].checked?
1170
- snumber = @data['포스트설정']['막글삽입시작숫자'].text.to_s.to_i
1171
- enumber = @data['포스트설정']['막글삽입끝숫자'].text.to_s.to_i
1172
- if @data['포스트설정']['막글투명'].checked?
1173
- content = content + '<div style="overflow:hidden; width:1px; height:1px" hidden><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;">' + @data['포스트설정']['막글'][0..rand(snumber..enumber)].split(' ').shuffle.join(' ') + '</td></tr></tbody></table></div>'
1264
+ if @data['포스트설정']['내용과자동생성'].checked? == false and @data['포스트설정']['내용을자동생성'].checked? == false and @data['포스트설정']['내용키워드삽입'].checked? == true
1265
+ puts '막글키워드삽입....'
1266
+ content333 = Array.new
1267
+ insert_keyword_text = keyword.to_s
1268
+ if @data['포스트설정']['키워드삽입'].checked?
1269
+ insert_keyword_text = ' <a href="'+@data['포스트설정']['키워드삽입시링크'].text.to_s+'" title="'+keyword.to_s+'">'+insert_keyword_text.to_s+'</a> '
1270
+ end
1271
+ content22 = last_text.split(" ")
1272
+ content22.each_with_index do |con, index|
1273
+ if position3[1..-1].include?(index)
1274
+ insert_keyword_text = keyword.to_s
1275
+ if @data['포스트설정']['키워드삽입'].checked?
1276
+ insert_keyword_text = ' <a href="'+@data['포스트설정']['키워드삽입시링크'].text.to_s+'" title="'+keyword.to_s+'">'+insert_keyword_text.to_s+'</a> '
1277
+ end
1278
+ con2 = con.split('')
1279
+ content333 << con2.join('')
1280
+ content333 << insert_keyword_text
1281
+ else
1282
+ content333 << con
1283
+ end
1284
+ end
1285
+ last_text = content333.join(" ")
1286
+
1287
+ if @data['포스트설정']['막글투명'].checked?
1288
+ content = content + "\n" + insert_keyword_text + "\n" + '<div style="overflow:hidden; width:1px; height:1px" hidden><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;">' + last_text + '</td></tr></tbody></table></div>'
1289
+ else
1290
+ content = content + "\n" + insert_keyword_text + "\n" + last_text
1291
+ end
1174
1292
  else
1175
- content = content + @data['포스트설정']['막글'][0..rand(snumber..enumber)].split(' ').shuffle.join(' ')
1293
+ snumber = @data['포스트설정']['막글삽입시작숫자'].text.to_s.to_i
1294
+ enumber = @data['포스트설정']['막글삽입끝숫자'].text.to_s.to_i
1295
+ last_text = @data['포스트설정']['막글'][0..rand(snumber..enumber)].split(' ').shuffle.join(' ')
1296
+
1297
+ if @data['포스트설정']['막글투명'].checked?
1298
+ content = content + '<div style="overflow:hidden; width:1px; height:1px" hidden><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;">' + last_text + '</td></tr></tbody></table></div>'
1299
+ else
1300
+ content = content + last_text
1301
+ end
1176
1302
  end
1177
1303
  end
1178
1304
 
@@ -1191,6 +1317,8 @@ class Wordpress
1191
1317
  @data2['tax_input[post_tag]'] = tag_memory.join(',')
1192
1318
  end
1193
1319
 
1320
+ content = content.split("\n\n").join('')
1321
+
1194
1322
  if @data['포스트설정']['중앙정렬'].checked?
1195
1323
  content = content.split("\n").map {|row| '<p style="text-align: center;">'+row+'</p>'}.join("\n")
1196
1324
  end
@@ -1301,7 +1429,7 @@ class Wordpress
1301
1429
  @data['포스트설정']['내용자동변경값'] = Hash.new
1302
1430
  @data['포스트설정']['막글'] = ''
1303
1431
  @data['포스트설정']['프록시리스트'] = Array.new
1304
- @user_login_ok = 0
1432
+ @user_login_ok = 1
1305
1433
  window('백링크 프로그램', 800, 540) {
1306
1434
  margined true
1307
1435
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: soonje_3
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.22
4
+ version: 4.0.27
5
5
  platform: ruby
6
6
  authors:
7
7
  - soonje
@@ -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.3.26
39
+ rubygems_version: 3.3.7
40
40
  signing_key:
41
41
  specification_version: 4
42
42
  summary: file to clipboard