soonje_3 4.0.14 → 4.0.26

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 +192 -55
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 798086da057d3beae2742b8580bb90363286df1d55d49a1d4ff9392db54bf4c9
4
- data.tar.gz: d6ccc5aef79fb7a700f244ce4fd5d7c91e21de6c82edc322bf63d69ec4ffd161
3
+ metadata.gz: 63e324a78bae12724ef70189020c0b4210547ed290b9ccd883d084791cc39c4f
4
+ data.tar.gz: 9b4385352b0fe16c52bc8fae12db4a1dab29eec64eaf6ee03cc375b37b6a5318
5
5
  SHA512:
6
- metadata.gz: caa2b7263a7f024011598f586e2606b605b7779e3ce6968fe16d90ec278a6b06247d6ec84aac2515f033a33291ecd4ff18ca66d39b3ecf2d001168b1d5eb3bfc
7
- data.tar.gz: 9697ae2eb43d0a99c1b82a98382feea8ae933a969d0402f206e2fa12def72fcc38a1739b16c4f86c699b0fce376a6a70e99051c7b431faef7608751a816146b1
6
+ metadata.gz: 161b8a0fcbb8ee1910845ec511cd191b5807c9f42ae24481a3fa4d55c6bf889ecf865f99f685b90ed24eacc7213f5ea6ea211dfeac10329c9fb787cb734bc2aa
7
+ data.tar.gz: 34a66fafe28a8266cb182e69198ce2601f0bb36583cba394bd2b16184fd4fb26d6fd879c063ae6bb2700bc8c5e68f6c49975cf0034a503d6fbabef9ab5e9ba77
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,31 +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
- noko = Nokogiri::HTML(@driver.page_source)
117
- tt = noko.xpath('//*[@id="main_pack"]/section/div/ul').text
118
- for page in 3..8
119
- @driver.get('https://www.google.com/search?q='+q.to_s+'&start='+(page*10).to_s)
120
- noko = Nokogiri::HTML(@driver.page_source)
121
- for n in 1..15
122
- tt2 = noko.xpath('//*[@id="rso"]/div['+n.to_s+']/div/div/div[2]/div').text
123
- 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
124
148
 
125
- else
126
- tt2 = tt2.split('...').join('')
127
- 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
128
162
  end
163
+ rescue
164
+ puts 'zum 검색 http error ...'
129
165
  end
130
166
  end
131
- @driver.close
132
- tt = tt.split(' ').shuffle.join(' ')[0..5000]
133
- m = Array.new
134
- for n in 0..19
135
- 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
136
199
  end
137
- return m.join("\n")
200
+
201
+ return text_array.uniq.shuffle.join("\n")[0..5000]
138
202
  end
139
203
 
140
204
  def chrome_start(url, user_id, user_pw)
@@ -573,9 +637,10 @@ class Wordpress
573
637
  while true
574
638
  check_success = 0
575
639
  @data['table'].each_with_index do |table,index|
640
+ begin
576
641
  status_timeout = Timeout::timeout(180) do
577
642
  begin
578
- if black_users.include?(table[2].to_s)
643
+ if black_users.include?(table[1].to_s)
579
644
  next
580
645
  end
581
646
  if table[4].to_i > table[6].to_i
@@ -680,7 +745,7 @@ class Wordpress
680
745
  @data['table'].pop
681
746
  login_check = login()
682
747
  if login_check == 0
683
- black_users << table[2].to_s
748
+ black_users << table[1].to_s
684
749
  next
685
750
  end
686
751
 
@@ -874,7 +939,14 @@ class Wordpress
874
939
  if @data['포스트설정']['내용과자동생성'].checked?
875
940
  content22 = content.split("(자동생성글)")[1].split("\n")
876
941
  else
877
- 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
878
950
  end
879
951
  position_point = rand(0..(content22.length-2))
880
952
  if position.include?(position_point)
@@ -904,19 +976,19 @@ class Wordpress
904
976
  content2 = content.split("\n")
905
977
  end
906
978
 
907
- while true
908
- check10 = 0
909
- for nn in 0..position.length-1
910
- if content2[position[nn]].to_s.include?('style') or content[position[nn]].to_s.include?('<') or content[position[nn]].to_s.include?('>')
911
- check10 = 1
912
- position[nn] += 1
913
- end
914
- end
915
- puts 'check10 => '+check10.to_s
916
- if check10 == 0
917
- break
918
- end
919
- 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
920
992
 
921
993
 
922
994
  content3 = Array.new
@@ -964,20 +1036,48 @@ class Wordpress
964
1036
  end
965
1037
 
966
1038
  if @data['포스트설정']['내용과자동생성'].checked? == false and @data['포스트설정']['내용을자동생성'].checked? == false
967
- content2.each_with_index do |con, index|
968
- if position.include?(index)
969
- insert_keyword_text = keyword.to_s
970
- if @data['포스트설정']['키워드삽입'].checked?
971
- 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
972
1045
  end
973
- con2 = con.split('')
974
- content3 << con2.join('')
975
- 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")
976
1064
  else
977
- 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")
978
1079
  end
979
1080
  end
980
- content = content3.join("\n")
981
1081
  end
982
1082
  end
983
1083
 
@@ -1161,12 +1261,44 @@ class Wordpress
1161
1261
  content = content+"\n\n"+content_end
1162
1262
 
1163
1263
  if @data['포스트설정']['막글삽입'].checked?
1164
- snumber = @data['포스트설정']['막글삽입시작숫자'].text.to_s.to_i
1165
- enumber = @data['포스트설정']['막글삽입끝숫자'].text.to_s.to_i
1166
- if @data['포스트설정']['막글투명'].checked?
1167
- 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
1168
1292
  else
1169
- 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
1170
1302
  end
1171
1303
  end
1172
1304
 
@@ -1185,6 +1317,8 @@ class Wordpress
1185
1317
  @data2['tax_input[post_tag]'] = tag_memory.join(',')
1186
1318
  end
1187
1319
 
1320
+ content = content.split("\n\n").join('')
1321
+
1188
1322
  if @data['포스트설정']['중앙정렬'].checked?
1189
1323
  content = content.split("\n").map {|row| '<p style="text-align: center;">'+row+'</p>'}.join("\n")
1190
1324
  end
@@ -1251,6 +1385,9 @@ class Wordpress
1251
1385
  end
1252
1386
  end
1253
1387
  end
1388
+ rescue
1389
+ puts '2시간 멈춤 방지...'
1390
+ end
1254
1391
  end
1255
1392
 
1256
1393
  if check_success == 0
@@ -1292,7 +1429,7 @@ class Wordpress
1292
1429
  @data['포스트설정']['내용자동변경값'] = Hash.new
1293
1430
  @data['포스트설정']['막글'] = ''
1294
1431
  @data['포스트설정']['프록시리스트'] = Array.new
1295
- @user_login_ok = 0
1432
+ @user_login_ok = 4
1296
1433
  window('백링크 프로그램', 800, 540) {
1297
1434
  margined true
1298
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.14
4
+ version: 4.0.26
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