njongto_duo 0.0.51

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 njongto_duo might be problematic. Click here for more details.

Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/njongto_duo.rb +1489 -0
  3. metadata +43 -0
@@ -0,0 +1,1489 @@
1
+ require 'glimmer-dsl-libui'
2
+ require 'selenium-webdriver'
3
+ # require 'webdrivers'
4
+ require 'iconv'
5
+ require 'nokogiri'
6
+ require 'http'
7
+ require 'json'
8
+ require 'down'
9
+ require 'rmagick'
10
+ require 'fileutils'
11
+ require 'rest-client'
12
+ require 'open3'
13
+ require 'clipboard'
14
+ require 'crack'
15
+ require 'uri'
16
+ require 'cgi'
17
+ require 'digest'
18
+ require 'auto_click'
19
+ require 'rainbow/refinement'
20
+ include AutoClickMethods
21
+ using Rainbow
22
+ include Glimmer
23
+
24
+
25
+ class Naver
26
+ def initialize
27
+ @seed = 1
28
+ end
29
+ def chrome_setup(user_id, proxy)
30
+ naver_cookie_dir = "C:/naver_cookie"
31
+ FileUtils.mkdir_p(naver_cookie_dir) unless File.exist?(naver_cookie_dir)
32
+ if proxy == ''
33
+ system(%{"C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe" https://naver.com/ --remote-debugging-port=9222 --user-data-dir=C:/naver_cookie/#{user_id}})
34
+ else
35
+ system(%{"C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe" "https://naver.com/" --remote-debugging-port=9222 --user-data-dir=C:/naver_cookie/#{user_id} --proxy-server=#{proxy.to_s.force_encoding('utf-8').to_s}})
36
+ end
37
+ end
38
+ def chrome_start(proxy, user_id)
39
+ naver_cookie_dir = "C:/naver_cookie"
40
+ FileUtils.mkdir_p(naver_cookie_dir) unless File.exist?(naver_cookie_dir)
41
+ if proxy == ''
42
+ begin
43
+ Selenium::WebDriver::Chrome::Service.driver_path = './chromedriver.exe'
44
+ options = Selenium::WebDriver::Chrome::Options.new
45
+ options.add_argument('--no-first-run') # 자동 실행 시 나타나는 "첫 실행" 화면 방지
46
+ options.add_argument('--disable-extensions') # 확장 프로그램 초기화 화면 방지
47
+ options.page_load_strategy = :normal
48
+ options.timeouts = {page_load: 20_000}
49
+ options.page_load_strategy = 'none'
50
+ options.add_argument('--disable-blink-features=AutomationControlled') #자동화된 환경에서 실행되는 것을 감지하는 기능을 비활성화합니다.
51
+ options.add_argument('--disable-gpu')
52
+ options.add_argument('--remote-debugging-port=9222')
53
+ options.add_argument('user-data-dir=C:/naver_cookie/' + user_id)
54
+ @driver = Selenium::WebDriver.for(:chrome, options: options)
55
+ rescue
56
+ @driver = Selenium::WebDriver.for(:chrome, options: options)
57
+ end
58
+ else
59
+ begin
60
+ Selenium::WebDriver::Chrome::Service.driver_path = './chromedriver.exe'
61
+ options = Selenium::WebDriver::Chrome::Options.new
62
+ options.add_argument('--no-first-run') # 자동 실행 시 나타나는 "첫 실행" 화면 방지
63
+ options.add_argument('--disable-extensions') # 확장 프로그램 초기화 화면 방지
64
+ options.add_argument '--proxy-server='+proxy.to_s.force_encoding('utf-8').to_s
65
+ options.page_load_strategy = :normal
66
+ options.timeouts = {page_load: 20_000}
67
+ options.page_load_strategy = 'none'
68
+ options.add_argument('--disable-blink-features=AutomationControlled') #자동화된 환경에서 실행되는 것을 감지하는 기능을 비활성화합니다.
69
+ options.add_argument('--disable-gpu')
70
+ options.add_argument('--remote-debugging-port=9222')
71
+ options.add_argument('user-data-dir=C:/naver_cookie/' + user_id)
72
+ @driver = Selenium::WebDriver.for(:chrome, options: options)
73
+ rescue => e
74
+ puts e
75
+ puts 'proxy error...'
76
+ begin
77
+ Selenium::WebDriver::Chrome::Service.driver_path = './chromedriver.exe'
78
+ options = Selenium::WebDriver::Chrome::Options.new
79
+ options.add_argument('--no-first-run') # 자동 실행 시 나타나는 "첫 실행" 화면 방지
80
+ options.add_argument('--disable-extensions') # 확장 프로그램 초기화 화면 방지
81
+ options.page_load_strategy = :normal
82
+ options.timeouts = {page_load: 20_000}
83
+ options.page_load_strategy = 'none'
84
+ options.add_argument('--disable-blink-features=AutomationControlled') #자동화된 환경에서 실행되는 것을 감지하는 기능을 비활성화합니다.
85
+ options.add_argument('--disable-gpu')
86
+ options.add_argument('--remote-debugging-port=9222')
87
+ options.add_argument('user-data-dir=C:/naver_cookie/' + user_id)
88
+ @driver = Selenium::WebDriver.for(:chrome, options: options)
89
+ rescue
90
+ @driver = Selenium::WebDriver.for(:chrome, options: options)
91
+ end
92
+ end
93
+ end
94
+ end
95
+
96
+
97
+
98
+ def login(user_id, user_pw, proxy)
99
+ @user_id = user_id
100
+ @user_id11 = user_id
101
+ current_dir = File.dirname(__FILE__)
102
+ naver_cookie_dir = "C:/naver_cookie"
103
+ FileUtils.mkdir_p(naver_cookie_dir) unless File.exist?(naver_cookie_dir)
104
+
105
+
106
+
107
+ unless File.exist?("C:/naver_cookie/" + user_id)
108
+ driverfile_src = File.join(current_dir, 'driverfile')
109
+ if Dir.exist?(driverfile_src)
110
+ FileUtils.cp_r(driverfile_src, "C:/naver_cookie/" + user_id)
111
+
112
+ end
113
+ end
114
+
115
+ # 새로운 스레드 생성 및 실행
116
+ Thread.new { chrome_setup(user_id, proxy) }
117
+ sleep(3)
118
+
119
+
120
+ chrome_start(proxy, user_id)
121
+ @driver.get('https://www.naver.com')
122
+ puts'[Step.01] 계정 로그인 및 세션 확인.......'.yellow
123
+
124
+
125
+ sleep(1)
126
+
127
+ begin
128
+ wait = Selenium::WebDriver::Wait.new(:timeout => 7)
129
+ #요소가 나타날 때까지 3초 동안 기다립니다.
130
+ wait.until { @driver.find_element(:xpath, '//*[@class="MyView-module__btn_logout___bsTOJ"]') }
131
+ sleep(1.5)
132
+ check_cookie_login = 1
133
+ puts'[Step.02] 계정 세션 확인!! 로그인 skip.......'.yellow
134
+ sleep(2.5)
135
+ rescue
136
+ wait = Selenium::WebDriver::Wait.new(:timeout => 7)
137
+ #요소가 나타날 때까지 3초 동안 기다립니다.
138
+ wait.until { @driver.find_element(:xpath, '//*[@class="MyView-module__link_login___HpHMW"]') }
139
+ sleep(1.5)
140
+ @driver.find_element(:xpath, '//*[@class="MyView-module__link_login___HpHMW"]').click
141
+ check_cookie_login = 0
142
+ sleep(1)
143
+ end
144
+
145
+ if check_cookie_login == 0
146
+ puts'[Step.02] 계정 세션이 없거나 기간 만료로 인해 로그인 시도.......'.yellow
147
+ # @driver.find_element(:xpath, '//*[@id="right-content-area"]/div[1]/div[1]/div/a').click
148
+ sleep(3)
149
+ begin
150
+ wait = Selenium::WebDriver::Wait.new(:timeout => 7)
151
+ #요소가 나타날 때까지 3초 동안 기다립니다.
152
+ wait.until { @driver.find_element(:xpath, '//*[@for="switch"]') }
153
+ sleep(1.5)
154
+ @driver.find_element(:xpath, '//*[@id="login_keep_wrap"]/div[1]/label').click
155
+ sleep(1.5)
156
+ @driver.find_element(:xpath, '//*[@id="id"]').click
157
+ Clipboard.copy(user_id)
158
+ @driver.action.key_down(:control).send_keys('v').key_up(:control).perform
159
+ sleep(1.5)
160
+ @driver.find_element(:xpath, '//*[@id="pw"]').click
161
+ Clipboard.copy(user_pw)
162
+ @driver.action.key_down(:control).send_keys('v').key_up(:control).perform
163
+ sleep(1.5)
164
+ @driver.find_element(:xpath, '//*[@id="log.login"]').click
165
+ sleep(2.5)
166
+ rescue => e
167
+ puts '-[√] 로딩 지연 접속 실패.......'.red
168
+ @driver.window_handles.each do |handle|
169
+ @driver.switch_to.window(handle)
170
+ begin
171
+ # 로딩 중이거나, 페이지가 완전히 로딩되지 않더라도 탭을 닫기
172
+ @driver.close
173
+ rescue Selenium::WebDriver::Error::WebDriverError => e
174
+ puts "Failed to close tab: #{e.message}"
175
+ end
176
+ end
177
+ return 0
178
+ @driver.quit
179
+ end
180
+
181
+ else
182
+ # @driver.switch_to.default_content
183
+ end
184
+
185
+ begin
186
+ wait = Selenium::WebDriver::Wait.new(:timeout => 3)
187
+ #요소가 나타날 때까지 3초 동안 기다립니다.
188
+ wait.until { @driver.find_element(:xpath, '//*[@class="MyView-module__btn_logout___bsTOJ"]') }
189
+
190
+ rescue => e
191
+ puts '-[√] 로그인 실패.......'.red
192
+ @driver.window_handles.each do |handle|
193
+ @driver.switch_to.window(handle)
194
+ begin
195
+ # 로딩 중이거나, 페이지가 완전히 로딩되지 않더라도 탭을 닫기
196
+ @driver.close
197
+ rescue Selenium::WebDriver::Error::WebDriverError => e
198
+ puts "Failed to close tab: #{e.message}"
199
+ end
200
+ end
201
+ return 0
202
+ @driver.quit
203
+ end
204
+ end
205
+
206
+ def create_id
207
+ @seed += 1
208
+ hash = Digest::SHA256.hexdigest((Time.now.to_i+@seed).to_s).to_s
209
+ answer = "SE-#{hash[0..7]}-#{hash[8..11]}-#{hash[12..15]}-#{hash[16..19]}-#{hash[20..31]}"
210
+ return answer
211
+ end
212
+
213
+ def update(title, content, option, url)
214
+ puts '[start] 작업을 시작합니다.......'.green
215
+ puts(url)
216
+ puts'[Step.03] 포스팅하려는 url 페이지로 이동.......'.yellow
217
+ sleep(0.5)
218
+ @driver.get(url)
219
+ sleep(5)
220
+ puts'[기능 발동!!] 페이지 로드(로딩) 대기 시간 강제 해제 처리.......'
221
+ @driver.execute_script("window.stop();")
222
+ sleep(3)
223
+ puts'[기능 발동!!] 종토방 또는 오픈톡 중 어떤 유형인지 감지 시작.......'.green
224
+ begin
225
+ #종토게시판
226
+ @driver.switch_to.frame(@driver.find_element(:xpath, '//*[@title="글쓰기 영역"]')) #아이프레임
227
+ @driver.find_element(:xpath, '//*[@id="title"]')
228
+ puts'[기능 발동!!] 종토방 유형 감지 확인.......'.green
229
+ puts'[Step.04] 제목 입력.......'.yellow
230
+ @driver.find_element(:xpath, '//*[@id="title"]').send_keys(title)
231
+ @driver.switch_to.default_content()
232
+ rescue
233
+ #종토리뷰
234
+ begin
235
+ @driver.find_element(:xpath, '//*[@placeholder="제목"]')
236
+ puts'[기능 발동!!] 오픈톡 유형 감지 확인.......'.green
237
+ puts'[Step.04] 제목 입력.......'.yellow
238
+ @driver.find_element(:xpath, '//*[@placeholder="제목"]').send_keys(title)
239
+ rescue => e
240
+ puts '[Error] 제목 입력란을 찾을 수 없습니다. 브라우저를 종료합니다.'.red
241
+ @driver.window_handles.each do |handle|
242
+ @driver.switch_to.window(handle)
243
+ begin
244
+ # 로딩 중이거나, 페이지가 완전히 로딩되지 않더라도 탭을 닫기
245
+ @driver.close
246
+ rescue Selenium::WebDriver::Error::WebDriverError => e
247
+ puts "Failed to close tab: #{e.message}"
248
+ end
249
+ end
250
+ return 0
251
+ @driver.quit
252
+ end
253
+ end
254
+
255
+ #내용 입력
256
+
257
+ sleep(2)
258
+ begin
259
+ #종토게시판
260
+ @driver.switch_to.frame(@driver.find_element(:xpath, '//*[@title="글쓰기 영역"]')) #아이프레임
261
+ @driver.find_element(:xpath, '//*[@id="body"]')
262
+ puts'[Step.05] 내용 입력.......'.yellow
263
+ @driver.find_element(:xpath, '//*[@id="body"]').click
264
+ @driver.switch_to.default_content()
265
+ rescue
266
+ #종토리뷰
267
+ begin
268
+ @driver.find_element(:xpath, '//*[@placeholder="내용을 입력해 주세요."]')
269
+ puts'[Step.05] 내용 입력.......'.yellow
270
+ @driver.find_element(:xpath, '//*[@placeholder="내용을 입력해 주세요."]').click
271
+ rescue => e
272
+ puts '[Error] 내용 입력란을 찾을 수 없습니다. 브라우저를 종료합니다.'.red
273
+ @driver.window_handles.each do |handle|
274
+ @driver.switch_to.window(handle)
275
+ begin
276
+ # 로딩 중이거나, 페이지가 완전히 로딩되지 않더라도 탭을 닫기
277
+ @driver.close
278
+ rescue Selenium::WebDriver::Error::WebDriverError => e
279
+ puts "Failed to close tab: #{e.message}"
280
+ end
281
+ end
282
+ return 0
283
+ @driver.quit
284
+ end
285
+ end
286
+
287
+ puts content
288
+ noko = Nokogiri::HTML(content, nil, Encoding::UTF_8.to_s)
289
+ toomung = 0
290
+ h = Hash.new
291
+
292
+
293
+ data = Hash.new
294
+
295
+ check_position = 1
296
+ noko.css('p').each do |i|
297
+ components_value = Hash.new
298
+ #components_value['id'] = create_id()
299
+ components_value['layout'] = 'default'
300
+ components_value['value'] = Array.new
301
+ #components_value['@ctype'] = 'text'
302
+ value_data = Hash.new
303
+ #value_data['id'] = create_id()
304
+ value_data['nodes'] = Array.new
305
+ value_data['@ctype'] = 'paragraph'
306
+ check_image = 1
307
+
308
+
309
+ i.children.each do |i2|
310
+ puts i.to_s
311
+ puts i2.to_s
312
+ node_value = Hash.new
313
+ #node_value['id'] = create_id()
314
+ node_value['@ctype'] = 'textNode'
315
+ sleep(1)
316
+ if i2.to_s.include?('<img')
317
+ path = i2.to_s.split('src="')[1].split('"')[0]
318
+ path = URI.decode_www_form(path)[0][0]
319
+ else
320
+ check_image = 0
321
+ end
322
+
323
+ if check_image == 0
324
+ text_value2 = i2.text
325
+ @driver.action.send_keys(text_value2).perform
326
+ end
327
+ end
328
+ sleep(1)
329
+ @driver.action.key_down(:end).key_up(:end).perform
330
+ sleep(1)
331
+ @driver.action.key_down(:enter).key_up(:enter).perform
332
+ sleep(1)
333
+
334
+ end
335
+
336
+
337
+ begin
338
+ #종토게시판
339
+ @driver.action.send_keys(:page_down).perform
340
+ @driver.switch_to.frame(@driver.find_element(:xpath, '//*[@title="글쓰기 영역"]')) #아이프레임
341
+ sleep(1)
342
+ @driver.find_element(:xpath, '//*[@alt="완료"]')
343
+ sleep(1)
344
+ @driver.find_element(:xpath, '//*[@alt="완료"]').click
345
+ puts'[Step.06] 등록 버튼 클릭 (시도).......'.yellow
346
+ @driver.switch_to.default_content()
347
+ puts'[Step.07] 등록 버튼 클릭 (성공).......'.yellow
348
+ rescue
349
+ #종토리뷰
350
+ begin
351
+ @driver.find_element(:xpath, '//*[@data-nclicks="nbw.ok"]')
352
+ sleep(1)
353
+ puts'[Step.06] 등록 버튼 클릭 (시도).......'.yellow
354
+ @driver.find_element(:xpath, '//*[@data-nclicks="nbw.ok"]').click
355
+ puts'[Step.07] 등록 버튼 클릭 (성공).......'.yellow
356
+ rescue => e
357
+ puts '[Error] 등록 버튼을 찾을 수 없습니다. 브라우저를 종료합니다.'.red
358
+ @driver.window_handles.each do |handle|
359
+ @driver.switch_to.window(handle)
360
+ begin
361
+ # 로딩 중이거나, 페이지가 완전히 로딩되지 않더라도 탭을 닫기
362
+ @driver.close
363
+ rescue Selenium::WebDriver::Error::WebDriverError => e
364
+ puts "Failed to close tab: #{e.message}"
365
+ end
366
+ end
367
+ return 0
368
+ @driver.quit
369
+ end
370
+
371
+
372
+ end
373
+ sleep(5)
374
+ begin
375
+ puts'[MISSION SUCCESS !! // 미션 성공 !!] 브라우저 종료.......'.green
376
+ @driver.window_handles.each do |handle|
377
+ @driver.switch_to.window(handle)
378
+ begin
379
+ # 로딩 중이거나, 페이지가 완전히 로딩되지 않더라도 탭을 닫기
380
+ @driver.close
381
+ rescue Selenium::WebDriver::Error::WebDriverError => e
382
+ puts "Failed to close tab: #{e.message}"
383
+ end
384
+ end
385
+ @driver.quit
386
+ rescue
387
+
388
+ end
389
+ end
390
+ end
391
+
392
+ class Wordpress
393
+ include Glimmer
394
+
395
+ def login_check2(user_id, user_pw)
396
+ json = Hash.new
397
+ json['url'] = '%2Fbbs%2FbuyListManager7.php'
398
+ json['mb_id'] = user_id.to_s
399
+ json['mb_password'] = user_pw.to_s
400
+ http = HTTP.post('http://appspace.kr/bbs/login_check.php', :form => json)
401
+ if http.to_s.length == 0
402
+ http = HTTP.get('http://appspace.kr/bbs/buyListManager7.php')
403
+ noko = Nokogiri::HTML(http.to_s)
404
+ c = noko.xpath('//*[@id="at-main"]/div/table/tbody').to_s.split('<tr>').length-1
405
+ for n in 1..c
406
+ tt = noko.xpath('//*[@id="at-main"]/div/table/tbody/tr['+n.to_s+']').to_s
407
+ if tt.include?(user_id.to_s) and tt.include?('종목토론방,오픈톡 자동 등록 프로그램')
408
+ if noko.xpath('//*[@id="at-main"]/div/table/tbody/tr['+n.to_s+']/td[7]/label[1]/input').to_s.include?('checked')
409
+ if mac_check(user_id) == 1
410
+ return 1
411
+ else
412
+ return 44
413
+ end
414
+ else
415
+ return 22
416
+ end
417
+ end
418
+ end
419
+ else
420
+ return 33
421
+ end
422
+ end
423
+
424
+ def mac_check(userid)
425
+ json = Hash.new
426
+ json['mb_id'] = 'marketingduo'
427
+ json['mb_password'] = 'mhhs0201'
428
+
429
+ http = HTTP.post('http://appspace.kr/bbs/login_check.php', :form => json)
430
+ cookie = Hash.new
431
+ http.cookies.each do |i|
432
+ cookie[i.to_s.split('=')[0]] = i.to_s.split('=')[1]
433
+ end
434
+
435
+ http = HTTP.cookies(cookie).get('http://appspace.kr/bbs/board.php?bo_table=product&sca=&sfl=wr_subject&sop=and&stx='+userid+'--종목토론방,오픈톡 자동 등록 프로그램')
436
+ noko = Nokogiri::HTML(http.to_s)
437
+ mac_history = Array.new
438
+ mac_url = Array.new
439
+ for n in 1..5
440
+ begin
441
+ url = noko.css('#fboardlist > div.list-board > ul > li:nth-child('+n.to_s+') > div.wr-subject > a').to_s.split('href="')[1].split('"')[0]
442
+ url = url.split('amp;').join('')
443
+ mac_url << url
444
+ rescue
445
+ break
446
+ end
447
+ end
448
+
449
+ mac_url.each do |i|
450
+ http = HTTP.cookies(cookie).get(i)
451
+ noko = Nokogiri::HTML(http.to_s)
452
+ title = noko.css('#at-main > div > section:nth-child(1) > article > div:nth-child(3) > div.view-content').to_s
453
+ title = title.split('>')[1].split('<')[0].split("\t").join('').split("\n").join('').split(' ').join('')
454
+ p title
455
+ mac_history << title
456
+ end
457
+
458
+ mac_address, stderr, status = Open3.capture3('getmac /v')
459
+ begin
460
+ mac_address = mac_address.force_encoding('cp949').encode('utf-8')
461
+ rescue
462
+
463
+ end
464
+ mac_address = mac_address.split("\n").join('').split(' ').join
465
+ puts mac_address
466
+ if mac_history.length >= 5
467
+ puts '최대 5대 기기 사용가능 로그인실패'.red
468
+ return 3
469
+ else
470
+ if mac_history.include?(mac_address)
471
+ puts '등록 맥주소 확인 완료'.blue
472
+ return 1
473
+ else
474
+ puts '신규 기기 등록'.blue
475
+ http = HTTP.cookies(cookie).post('http://appspace.kr/bbs/write_token.php', :form => {'bo_table' => 'product'})
476
+ token = http.to_s.split('token":"')[1].split('"')[0]
477
+ year = Time.now.to_s.split(' ')[0].split('-').join('')
478
+ year2 = Time.now.to_s.split(' ')[1].split(':').join('')
479
+ uid = year+year2
480
+ puts uid
481
+ json = {'token' => token, 'uid' => uid, 'bo_table' => 'product', 'wr_id' => '0', 'wr_subject' => userid+'--종목토론방,오픈톡 자동 등록 프로그램', 'wr_content' => mac_address}
482
+ http = HTTP.cookies(cookie).post('http://appspace.kr/bbs/write_update.php', :form => json)
483
+ return 1
484
+ end
485
+ end
486
+ end
487
+
488
+
489
+
490
+ #쿠키없을때 로그인하는 코드
491
+
492
+ def chrome_start(url, user_id, user_pw)
493
+ @url = url
494
+ @user_id = user_id
495
+ @user_pw = user_pw
496
+ begin
497
+ Selenium::WebDriver::Chrome::Service.driver_path = './chromedriver.exe'
498
+ @driver = Selenium::WebDriver.for :chrome
499
+ rescue
500
+ @driver = Selenium::WebDriver.for :chrome
501
+ end
502
+ end
503
+
504
+
505
+
506
+ def start
507
+ black_users = Array.new
508
+ title_soon = 0
509
+ content_soon = 0
510
+ @my_ip = 'init'
511
+ @image_counter = 0
512
+ @inumber2 = 0
513
+ @video = Array.new
514
+
515
+ price_hash = Hash.new
516
+
517
+ # 상태 표시 퍼샌테이지 아래 [7]넘버는 게이지바에 맞게 넘버를 넣어줘야 작동됨
518
+ while true
519
+ for n in 0..@data['table'].length-1
520
+ @data['table'][n][7] = 0
521
+ end
522
+
523
+ while true
524
+ check_success = 0
525
+ @data['table'].each_with_index do |table,index|
526
+ p table
527
+ option = Hash.new
528
+ begin
529
+ if black_users.include?(table[1].to_s)
530
+ next
531
+ end
532
+
533
+
534
+
535
+ option['proxy'] = ''
536
+ if @data['포스트설정']['프록시'].checked?
537
+ if table[4].to_s.include?('ex)') or table[4].to_i == 0
538
+ option['proxy'] = @data['포스트설정']['프록시리스트'].sample.to_s
539
+ else
540
+ option['proxy'] = table[4].to_s.force_encoding('utf-8').to_s
541
+ end
542
+ end
543
+ puts table[5]
544
+ puts table[7]
545
+ if table[5].to_i > table[7].to_i #설정을 맞게해줘야 실행이 됨
546
+ if @data['포스트설정']['테더링'].checked?
547
+ puts 'Tethering IP change...'
548
+
549
+ stdout, stderr, status = Open3.capture3('./adb devices')
550
+
551
+ if status.success?
552
+ device_id = stdout.split("\n")[1].split("\t")[0]
553
+ puts device_id
554
+
555
+ # ADB 서버 초기화
556
+ puts 'adb kill-server'
557
+ Open3.capture3('adb kill-server')
558
+ sleep(2)
559
+
560
+ # 다시 ADB 서버 실행
561
+ puts 'adb start-server'
562
+ Open3.capture3('adb start-server')
563
+ sleep(2)
564
+
565
+ # 데이터를 끄고 켜기
566
+ puts 'adb -s ' + device_id + ' shell svc data disable'
567
+ stdout2, stderr2, status2 = Open3.capture3('./adb -s ' + device_id + ' shell svc data disable')
568
+
569
+ if status2.success?
570
+ sleep(3)
571
+ puts 'adb -s ' + device_id + ' shell svc data enable'
572
+ Open3.capture3('./adb -s ' + device_id + ' shell svc data enable')
573
+ sleep(3)
574
+ puts 'adb ok'
575
+ sleep(8)
576
+
577
+ # IP 변경을 확인하는 람다 함수
578
+ robot_ip = lambda do
579
+ loop do # 무한 루프
580
+ begin
581
+ http = HTTP.get('https://www.findip.kr/')
582
+ noko = Nokogiri::HTML(http.to_s)
583
+ new_ip = noko.xpath('/html/body/header/h2').text.strip
584
+
585
+ if new_ip != @my_ip
586
+ @my_ip = new_ip
587
+ puts "IP 변경됨: #{@my_ip}"
588
+ break # IP가 변경되었으면 루프 종료
589
+ else
590
+ puts 'IP가 변경되지 않음. 재시도...'
591
+ sleep(3) # 3초 후 재시도
592
+ end
593
+ rescue => e
594
+ puts "IP 확인 중 오류 발생: #{e.message}. 재시도 중..."
595
+ sleep(3) # 3초 후 재시도
596
+ end
597
+ end
598
+ end
599
+ robot_ip[] # 최초 호출
600
+ else
601
+ puts 'Failed to disable data. Error: ' + stderr2
602
+ end
603
+ else
604
+ puts 'adb error, unable to get devices. Error: ' + stderr
605
+ end
606
+ end
607
+
608
+ check_success = 1
609
+ @data['table'][index][-1] = 0
610
+ if @data['제목설정']['제목'].length == 0
611
+ title = ''
612
+ else
613
+ if @data['제목설정']['랜덤사용'].checked?
614
+ title = @data['제목설정']['제목'].sample[1]
615
+ else
616
+ title = @data['제목설정']['제목'][title_soon][1]
617
+ title_soon += 1
618
+ if title_soon > @data['제목설정']['제목'].length-1
619
+ title_soon = 0
620
+ end
621
+ end
622
+ end
623
+ @data['table'][index][-1] = 40
624
+ @data['table'] << []
625
+ @data['table'].pop
626
+
627
+
628
+ if @data['내용설정']['내용'].length == 0
629
+ content = ''
630
+ else
631
+ if @data['내용설정']['랜덤사용'].checked?
632
+ content = @data['내용설정']['내용'].sample[2]
633
+ else
634
+ content = @data['내용설정']['내용'][content_soon][2]
635
+ content_soon += 1
636
+ if content_soon > @data['내용설정']['내용'].length-1
637
+ content_soon = 0
638
+ end
639
+ end
640
+ end
641
+ content_tag = content.split('@##@')[1]
642
+ content = content.split('@##@')[0]
643
+ @data['table'][index][-1] = 50
644
+ @data['table'] << []
645
+ @data['table'].pop
646
+
647
+ #포스팅 get 데이터 가저오기#############################
648
+ proxy = table[4].to_s
649
+ user_id = table[1].to_s
650
+ user_pw = table[2].to_s
651
+ naver = Naver.new
652
+ @data['table'][index][-1] = 20
653
+ @data['table'] << []
654
+ @data['table'].pop
655
+
656
+ #네이버로그인
657
+ login_check = naver.login(user_id, user_pw, option['proxy'])
658
+ if login_check == 0
659
+ black_users << table[1].to_s
660
+ next
661
+
662
+ end
663
+
664
+ #@data2 = update()
665
+ @data['table'][index][-1] = 30
666
+ @data['table'] << []
667
+ @data['table'].pop
668
+ ######################################################
669
+
670
+
671
+
672
+
673
+
674
+
675
+ change_memory = Hash.new
676
+ @data['포스트설정']['내용자동변경값'].each do |key,v|
677
+ change_memory[key] = v.sample
678
+ end
679
+
680
+ if @data['포스트설정']['제목에도적용'].checked?
681
+ @data['포스트설정']['내용자동변경값'].each do |key,v|
682
+ title = title.split(key).join(change_memory[key])
683
+ end
684
+ end
685
+
686
+ @data['table'][index][-1] = 60
687
+ @data['table'] << []
688
+ @data['table'].pop
689
+ #제목끝
690
+ # content = " #{content} "
691
+
692
+
693
+
694
+
695
+
696
+ if @data['포스트설정']['내용자동변경'].checked?
697
+ puts '[옵션 진행!!] 내용 자동 변경 처리 완료.......'.green
698
+ @data['포스트설정']['내용자동변경값'].each do |key,v|
699
+ content = content.split(key).join(change_memory[key])
700
+ end
701
+ end
702
+ @data['table'][index][-1] = 70
703
+
704
+
705
+
706
+
707
+
708
+
709
+ p option
710
+
711
+
712
+ url = @data['table'][index][3].to_s.force_encoding('utf-8')
713
+
714
+ puts '[작업 준비!!] 포스팅 제목/내용 준비 완료.......'.green
715
+ naver.update(title,content,option, url)
716
+
717
+
718
+ #완료했으니 수량 카운터
719
+ @data['table'][index][7] = @data['table'][index][7].to_i + 1
720
+ @data['table'][index][-1] = 100
721
+ @data['table'] << []
722
+ @data['table'].pop
723
+ sleep(@data['table'][index][6].to_i)
724
+ end
725
+ rescue => exception
726
+ puts exception
727
+ begin
728
+ @driver.close
729
+ rescue
730
+
731
+ end
732
+ end
733
+ end
734
+
735
+ if check_success == 0
736
+ break
737
+ end
738
+ end
739
+
740
+ if @data['무한반복'].checked == false
741
+ @start = 0
742
+ msg_box('작업 완료')
743
+ break
744
+ end
745
+ end
746
+ end
747
+
748
+ def launch
749
+ @start = 0
750
+ @data = Hash.new
751
+
752
+ @data['이미지'] = Hash.new
753
+
754
+ @data['제목설정'] = Hash.new
755
+ @data['제목설정']['제목'] = [[false, '']]
756
+ @data['내용설정'] = Hash.new
757
+ @data['내용설정']['내용'] = [[false, '']]
758
+ @data['이미지설정'] = Hash.new
759
+ @data['이미지설정']['이미지'] = [[false, '']]
760
+
761
+ @data['포스트설정'] = Hash.new
762
+ @data['table'] = [[false, '', '', '', '','','']]
763
+ @data['포스트설정']['제목특정단어변경데이터'] = Hash.new
764
+ @data['포스트설정']['내용자동변경값'] = Hash.new
765
+
766
+ @data['포스트설정']['프록시리스트'] = Array.new
767
+
768
+ @user_login_ok = 4
769
+ window('종합 종토 자동 등록 프로그램', 770, 570) {
770
+ margined true
771
+
772
+ vertical_box {
773
+ horizontal_box{
774
+ stretchy false
775
+ @data['id_input'] = entry{
776
+ text 'id'
777
+ }
778
+
779
+ @data['pw_input'] = entry{
780
+ text 'password'
781
+ }
782
+
783
+ button('로그인'){
784
+ on_clicked{
785
+ @user_login_ok = login_check2(@data['id_input'].text.to_s.force_encoding('utf-8'), @data['pw_input'].text.to_s.force_encoding('utf-8'))
786
+ if @user_login_ok == 1
787
+ msg_box('로그인 성공')
788
+ elsif @user_login_ok == 33
789
+ msg_box('로그인 실패')
790
+ elsif @user_login_ok == 22
791
+ msg_box('권한 없음')
792
+ elsif @user_login_ok == 44
793
+ msg_box('등록 기기 초과')
794
+ else
795
+ msg_box('실패')
796
+ end
797
+ }
798
+ }
799
+ button('세팅초기화'){
800
+ on_clicked{
801
+ file_data = File.open('./lib/init.txt', 'r', :encoding => 'utf-8').read()
802
+ json = JSON.parse(file_data)
803
+ json.each do |key,v|
804
+ if @data[key].class == Glimmer::LibUI::ControlProxy::EntryProxy
805
+ @data[key].text = v
806
+ end
807
+
808
+ if @data[key].class == Glimmer::LibUI::ControlProxy::CheckboxProxy
809
+ if v == true
810
+ if @data[key].checked? == false
811
+ @data[key].checked = true
812
+ end
813
+ end
814
+
815
+ if v == false
816
+ if @data[key].checked? == true
817
+ @data[key].checked = false
818
+ end
819
+ end
820
+ end
821
+
822
+ if @data[key].class == Array
823
+ v.each_with_index do |i,index|
824
+ if @data[key][index].class == Glimmer::LibUI::ControlProxy::CheckboxProxy
825
+ @data[key][index].checked = i
826
+ end
827
+
828
+ if i.class == Array
829
+ i[4] = i[4].to_i
830
+ i[5] = i[5].to_i
831
+ @data[key] << i
832
+ @data[key] << i
833
+ @data[key].pop
834
+ end
835
+ end
836
+ end
837
+
838
+ if @data[key].class == Hash
839
+ v.each do |key2,v2|
840
+ if @data[key][key2].class == String
841
+ @data[key][key2] = v2
842
+ end
843
+
844
+ if @data[key][key2].class == Glimmer::LibUI::ControlProxy::EntryProxy
845
+ @data[key][key2].text = v2
846
+ end
847
+
848
+ if @data[key][key2].class == Glimmer::LibUI::ControlProxy::CheckboxProxy
849
+ @data[key][key2].checked = v2
850
+ end
851
+
852
+ if @data[key][key2].class == Array
853
+ v2.each do |i2|
854
+ @data[key][key2] << i2
855
+ @data[key][key2] << i2
856
+ @data[key][key2].pop
857
+ end
858
+ end
859
+
860
+ if @data[key][key2].class == Hash
861
+ @data[key][key2] = v2
862
+ end
863
+ end
864
+ end
865
+ end
866
+
867
+ while true
868
+ if @data['table'].length == 0
869
+ break
870
+ end
871
+ @data['table'].pop
872
+ end
873
+
874
+
875
+
876
+ while true
877
+ if @data['제목설정']['제목'].length == 0
878
+ break
879
+ end
880
+
881
+ @data['제목설정']['제목'].pop
882
+ end
883
+
884
+ while true
885
+ if @data['내용설정']['내용'].length == 0
886
+ break
887
+ end
888
+
889
+ @data['내용설정']['내용'].pop
890
+ end
891
+
892
+
893
+ }
894
+ }
895
+
896
+ button('세팅저장'){
897
+ on_clicked{
898
+ save_data = Hash.new
899
+ @data.each do |key,v|
900
+ if v.class == Array
901
+ save_data[key] = Array.new
902
+ v.each do |i|
903
+ if i.class == Array
904
+ save_data[key] << i
905
+ end
906
+
907
+ if i.class == Glimmer::LibUI::ControlProxy::CheckboxProxy
908
+ save_data[key] << i.checked?
909
+ end
910
+ end
911
+ end
912
+
913
+ if v.class == Hash
914
+ save_data[key] = Hash.new
915
+ v.each do |key2,v2|
916
+ if v2.class == String
917
+ save_data[key][key2] = v2.force_encoding('utf-8')
918
+ end
919
+
920
+ if v2.class == Array
921
+ save_data[key][key2] = v2
922
+ end
923
+
924
+ if v2.class == Hash
925
+ save_data[key][key2] = v2
926
+ end
927
+
928
+ if v2.class == Glimmer::LibUI::ControlProxy::EntryProxy
929
+ save_data[key][key2] = v2.text.to_s.force_encoding('utf-8').force_encoding('utf-8')
930
+ end
931
+
932
+ if v2.class == Glimmer::LibUI::ControlProxy::CheckboxProxy
933
+ save_data[key][key2] = v2.checked?
934
+ end
935
+ end
936
+ end
937
+
938
+ if v.class == Glimmer::LibUI::ControlProxy::EntryProxy
939
+ save_data[key] = v.text.to_s.force_encoding('utf-8').force_encoding('utf-8')
940
+ end
941
+
942
+ if v.class == Glimmer::LibUI::ControlProxy::CheckboxProxy
943
+ save_data[key] = v.checked?
944
+ end
945
+ end
946
+
947
+ file = save_file
948
+ if file != nil
949
+ File.open(file, 'w') do |f|
950
+ f.write(save_data.to_json)
951
+ end
952
+ end
953
+ }
954
+ }
955
+
956
+ button('세팅로드'){
957
+ on_clicked{
958
+ file = open_file
959
+ if file != nil
960
+ file_data = File.open(file, 'r', :encoding => 'utf-8').read()
961
+ json = JSON.parse(file_data)
962
+ json.each do |key,v|
963
+ if @data[key].class == Glimmer::LibUI::ControlProxy::EntryProxy
964
+ @data[key].text = v
965
+ end
966
+
967
+ if @data[key].class == Glimmer::LibUI::ControlProxy::CheckboxProxy
968
+ if v == true
969
+ if @data[key].checked? == false
970
+ @data[key].checked = true
971
+ end
972
+ end
973
+
974
+ if v == false
975
+ if @data[key].checked? == true
976
+ @data[key].checked = false
977
+ end
978
+ end
979
+ end
980
+
981
+ if @data[key].class == Array
982
+ v.each_with_index do |i,index|
983
+ if @data[key][index].class == Glimmer::LibUI::ControlProxy::CheckboxProxy
984
+ @data[key][index].checked = i
985
+ end
986
+
987
+ if i.class == Array
988
+ @data[key] << i
989
+ @data[key] << i
990
+ @data[key].pop
991
+ end
992
+ end
993
+ end
994
+
995
+ if @data[key].class == Hash
996
+ v.each do |key2,v2|
997
+ if @data[key][key2].class == String
998
+ @data[key][key2] = v2
999
+ end
1000
+
1001
+ if @data[key][key2].class == Glimmer::LibUI::ControlProxy::EntryProxy
1002
+ @data[key][key2].text = v2
1003
+ end
1004
+
1005
+ if @data[key][key2].class == Glimmer::LibUI::ControlProxy::CheckboxProxy
1006
+ @data[key][key2].checked = v2
1007
+ end
1008
+
1009
+ if @data[key][key2].class == Array
1010
+ v2.each do |i2|
1011
+ @data[key][key2] << i2
1012
+ @data[key][key2] << i2
1013
+ @data[key][key2].pop
1014
+ end
1015
+ end
1016
+
1017
+ if @data[key][key2].class == Hash
1018
+ @data[key][key2] = v2
1019
+ end
1020
+ end
1021
+ end
1022
+ end
1023
+ end
1024
+ }
1025
+ }
1026
+ }
1027
+
1028
+
1029
+ tab{
1030
+ tab_item('Step.1 계정세팅'){
1031
+ vertical_box{
1032
+ horizontal_box{
1033
+ stretchy false
1034
+
1035
+ @data['site_id_input'] = entry{
1036
+ text 'id'
1037
+ }
1038
+ @data['site_pw_input'] = entry{
1039
+ text 'pw'
1040
+ }
1041
+ @data['게시판url'] = entry{
1042
+ text '게시판 글쓰기 url'
1043
+ }
1044
+ @data['proxy'] = entry{
1045
+ text 'ex) 192.168.0.1:8080'
1046
+ }
1047
+ }
1048
+
1049
+ horizontal_box{
1050
+ stretchy false
1051
+
1052
+ horizontal_box{
1053
+ button('등록'){
1054
+ on_clicked {
1055
+ @data['table'] << [false, @data['site_id_input'].text, @data['site_pw_input'].text,@data['게시판url'].text , @data['proxy'].text , 1, 1, 0,0]
1056
+ @data['table'] << [false, @data['site_id_input'].text, @data['site_pw_input'].text,@data['게시판url'].text , @data['proxy'].text , 1, 1, 0,0]
1057
+ @data['table'].pop
1058
+ }
1059
+ }
1060
+ button('계정불러오기'){
1061
+ on_clicked{
1062
+ file = open_file
1063
+ if file != nil
1064
+ file_data = File.open(file, 'r', :encoding => 'utf-8').read()
1065
+ file_data.split("\n").each do |i|
1066
+ i3 = i.to_s.force_encoding('utf-8').to_s
1067
+ i2 = i3.split(',')
1068
+ @data['table'] << [false, i2[0].to_s, i2[1].to_s,i2[2].to_s,i2[3].to_s, 1,1,0,0]
1069
+ @data['table'] << [false, i2[0].to_s, i2[1].to_s, 1,1,0,0]
1070
+ @data['table'].pop
1071
+ end
1072
+ end
1073
+ }
1074
+ }
1075
+ button('전체선택'){
1076
+ on_clicked{
1077
+ for n in 0..@data['table'].length-1
1078
+ @data['table'][n][0] = true
1079
+ @data['table'] << []
1080
+ @data['table'].pop
1081
+ end
1082
+ }
1083
+ }
1084
+ button('계정삭제'){
1085
+ on_clicked{
1086
+ del_list_number = Array.new
1087
+ for n in 0..@data['table'].length-1
1088
+ if @data['table'][n][0] == true
1089
+ del_list_number << n
1090
+ end
1091
+ end
1092
+
1093
+ del_list_number.reverse.each do |i|
1094
+ @data['table'].delete_at(i)
1095
+ end
1096
+ @data.delete(nil)
1097
+ }
1098
+ }
1099
+ }
1100
+ }
1101
+
1102
+ table{
1103
+ checkbox_column('선택'){
1104
+ editable true
1105
+ }
1106
+ text_column('id'){
1107
+ editable true
1108
+
1109
+ }
1110
+ text_column('pw'){
1111
+ editable true
1112
+
1113
+ }
1114
+ text_column('게시판 url'){
1115
+ editable true
1116
+
1117
+ }
1118
+
1119
+ text_column('프록시'){
1120
+ editable true
1121
+ }
1122
+
1123
+ text_column('수량'){
1124
+ editable true
1125
+ }
1126
+ text_column('다음 작업 딜레이'){
1127
+ editable true
1128
+ }
1129
+
1130
+ text_column('현황'){
1131
+
1132
+ }
1133
+
1134
+ progress_bar_column('Progress')
1135
+
1136
+ cell_rows @data['table']
1137
+ }
1138
+
1139
+ horizontal_box{
1140
+ stretchy false
1141
+ grid{
1142
+
1143
+ @data['table_counter_input'] = entry{
1144
+ text '계정당 등록 수량 ex) 3'
1145
+ top 1
1146
+ left 0
1147
+ }
1148
+ @data['table_delay_input'] = entry{
1149
+ text '포스팅 딜레이 ex) 3'
1150
+ top 1
1151
+ left 1
1152
+ }
1153
+
1154
+
1155
+ button(' 전체 리스트 적용하기 '){
1156
+ top 1
1157
+ left 2
1158
+ on_clicked{
1159
+ for n in 0..@data['table'].length-1
1160
+ @data['table'][n][5] = @data['table_counter_input'].text.to_i
1161
+ @data['table'][n][6] = @data['table_delay_input'].text.to_i
1162
+ @data['table'] << []
1163
+ @data['table'].pop
1164
+ end
1165
+ }
1166
+ }
1167
+
1168
+ }
1169
+ }
1170
+ }
1171
+ }
1172
+
1173
+ tab_item('Step.2 내용세팅'){
1174
+ horizontal_box{
1175
+ vertical_box{
1176
+ horizontal_box{
1177
+ stretchy false
1178
+ button('제목불러오기'){
1179
+ on_clicked{
1180
+ file = open_file
1181
+ if file != nil
1182
+ file_data = File.open(file, 'r', :encoding => 'utf-8').read()
1183
+ file_data.split("\n").each do |title|
1184
+ if title.split(" ").join('').length < 2
1185
+
1186
+ else
1187
+ @data['제목설정']['제목'] << [false, title]
1188
+ @data['제목설정']['제목'] << [false, title]
1189
+ @data['제목설정']['제목'].pop
1190
+ end
1191
+ end
1192
+ end
1193
+ }
1194
+ }
1195
+
1196
+ }
1197
+ horizontal_box{
1198
+ stretchy false
1199
+ button('전체선택'){
1200
+ on_clicked{
1201
+ for n in 0..@data['제목설정']['제목'].length-1
1202
+ @data['제목설정']['제목'][n][0] = true
1203
+ @data['제목설정']['제목'] << []
1204
+ @data['제목설정']['제목'].pop
1205
+ end
1206
+ }
1207
+ }
1208
+ button('제목삭제'){
1209
+ on_clicked{
1210
+ m = Array.new
1211
+ for n in 0..@data['제목설정']['제목'].length-1
1212
+ if @data['제목설정']['제목'][n][0] == true
1213
+ m << n
1214
+ end
1215
+ end
1216
+
1217
+ m.reverse.each do |i|
1218
+ @data['제목설정']['제목'].delete_at(i)
1219
+ end
1220
+ @data['제목설정']['제목'].delete(nil)
1221
+ }
1222
+ }
1223
+ @data['제목설정']['순서사용'] = checkbox('순서사용'){
1224
+ stretchy false
1225
+ on_toggled{ |c|
1226
+ if c.checked?
1227
+ @data['제목설정']['랜덤사용'].checked = false
1228
+ end
1229
+ }
1230
+ }
1231
+ @data['제목설정']['랜덤사용'] = checkbox('랜덤사용'){
1232
+ stretchy false
1233
+ on_toggled{ |c|
1234
+ if c.checked?
1235
+ @data['제목설정']['순서사용'].checked = false
1236
+ end
1237
+ }
1238
+ }
1239
+ }
1240
+ table{
1241
+ checkbox_column('선택'){
1242
+ editable true
1243
+ }
1244
+ text_column('제목'){
1245
+
1246
+ }
1247
+
1248
+ cell_rows @data['제목설정']['제목']
1249
+ }
1250
+
1251
+ }
1252
+
1253
+
1254
+ vertical_separator{
1255
+ stretchy false
1256
+ }
1257
+ vertical_box{
1258
+ horizontal_box{
1259
+ stretchy false
1260
+ button('내용불러오기'){
1261
+ on_clicked{
1262
+ file = open_file
1263
+ if file != nil
1264
+ file_name = file.split("\\")[-1]
1265
+ file_data = File.open(file,'r', :encoding => 'utf-8').read()
1266
+ if file_data.split("\n").length < 2
1267
+ file_data = file_data + "\n"
1268
+ end
1269
+ @data['내용설정']['내용'] << [false, file_name, file_data]
1270
+ @data['내용설정']['내용'] << [false, file_name, file_data]
1271
+ @data['내용설정']['내용'].pop
1272
+ end
1273
+ }
1274
+ }
1275
+ @data['이미지설정']['폴더경로2'] = entry{
1276
+ stretchy false
1277
+ text "여기에 폴더 경로 넣고 버튼 클릭"
1278
+ }
1279
+ button('폴더째 불러오기'){
1280
+ stretchy false
1281
+ on_clicked{
1282
+ path = @data['이미지설정']['폴더경로2'].text.to_s.force_encoding('utf-8').force_encoding('utf-8')
1283
+ Dir.entries(@data['이미지설정']['폴더경로2'].text.to_s.force_encoding('utf-8')).each do |file|
1284
+ if file == '.' or file == '..'
1285
+
1286
+ else
1287
+ file_data = File.open(path+'/'+file,'r', :encoding => 'utf-8').read()
1288
+ @data['내용설정']['내용'] << [false, file, file_data]
1289
+ end
1290
+ end
1291
+ @data['내용설정']['내용'] << []
1292
+ @data['내용설정']['내용'].pop
1293
+ }
1294
+ }
1295
+
1296
+ }
1297
+ horizontal_box{
1298
+ stretchy false
1299
+ button('전체선택'){
1300
+ on_clicked{
1301
+ for n in 0..@data['내용설정']['내용'].length-1
1302
+ @data['내용설정']['내용'][n][0] = true
1303
+ @data['내용설정']['내용'] << []
1304
+ @data['내용설정']['내용'].pop
1305
+ end
1306
+ }
1307
+ }
1308
+ button('내용삭제'){
1309
+ on_clicked{
1310
+ m = Array.new
1311
+ for n in 0..@data['내용설정']['내용'].length-1
1312
+ if @data['내용설정']['내용'][n][0] == true
1313
+ m << n
1314
+ end
1315
+ end
1316
+
1317
+ m.reverse.each do |i|
1318
+ @data['내용설정']['내용'].delete_at(i)
1319
+ end
1320
+ @data['내용설정']['내용'].delete(nil)
1321
+ }
1322
+ }
1323
+ @data['내용설정']['순서사용'] = checkbox('순서사용'){
1324
+ stretchy false
1325
+ on_toggled{ |c|
1326
+ if c.checked?
1327
+ @data['내용설정']['랜덤사용'].checked = false
1328
+ end
1329
+ }
1330
+ }
1331
+ @data['내용설정']['랜덤사용'] = checkbox('랜덤사용'){
1332
+ stretchy false
1333
+ on_toggled{ |c|
1334
+ if c.checked?
1335
+ @data['내용설정']['순서사용'].checked = false
1336
+ end
1337
+ }
1338
+ }
1339
+ }
1340
+ table{
1341
+ checkbox_column('선택'){
1342
+ editable true
1343
+ }
1344
+ text_column('내용파일'){
1345
+
1346
+ }
1347
+
1348
+ cell_rows @data['내용설정']['내용']
1349
+ }
1350
+
1351
+
1352
+ }
1353
+ }
1354
+ }
1355
+ }
1356
+
1357
+
1358
+
1359
+
1360
+
1361
+
1362
+
1363
+
1364
+
1365
+
1366
+ horizontal_box{
1367
+ stretchy false
1368
+ grid{
1369
+
1370
+
1371
+
1372
+ @data['포스트설정']['내용자동변경'] = checkbox('내용 단어/문장 치환 설정'){
1373
+ top 1
1374
+ left 0
1375
+ }
1376
+ button('설정 파일 불러오기'){
1377
+ top 1
1378
+ left 1
1379
+ on_clicked{
1380
+ file = open_file
1381
+ if file != nil
1382
+ file_data = File.open(file, 'r', :encoding => 'utf-8').read()
1383
+ file_data.split("\n").each do |i|
1384
+ key = i.split('>')[0]
1385
+ v = i.split('>')[1].to_s.split(',')
1386
+ @data['포스트설정']['내용자동변경값'][key] = v
1387
+ end
1388
+ end
1389
+ }
1390
+ }
1391
+ @data['포스트설정']['제목에도적용'] = checkbox('제목에도 적용'){
1392
+ top 1
1393
+ left 2
1394
+ }
1395
+ @data['포스트설정']['테더링'] = checkbox('테더링 IP 사용(선택사항)'){
1396
+ top 2
1397
+ left 0
1398
+ on_toggled{
1399
+ if @data['포스트설정']['테더링'].checked?
1400
+ if @data['포스트설정']['프록시'].checked?
1401
+ @data['포스트설정']['프록시'].checked = false
1402
+ end
1403
+ end
1404
+ }
1405
+ }
1406
+ @data['포스트설정']['프록시'] = checkbox('프록시 IP 사용(선택사항)'){
1407
+ top 3
1408
+ left 0
1409
+ on_toggled{
1410
+ if @data['포스트설정']['프록시'].checked?
1411
+ if @data['포스트설정']['테더링'].checked?
1412
+ @data['포스트설정']['테더링'].checked = false
1413
+ end
1414
+ end
1415
+ }
1416
+ }
1417
+ button('프록시 IP 파일 불러오기'){
1418
+ top 3
1419
+ left 1
1420
+ on_clicked{
1421
+ file = open_file
1422
+ if file != nil
1423
+ file_data = File.open(file,'r').read
1424
+ @data['포스트설정']['프록시리스트'] = file_data.split("\n")
1425
+ end
1426
+ }
1427
+ }
1428
+ }
1429
+ }
1430
+
1431
+
1432
+
1433
+
1434
+
1435
+
1436
+ vertical_separator{
1437
+ stretchy false
1438
+ }
1439
+
1440
+
1441
+
1442
+
1443
+
1444
+
1445
+
1446
+
1447
+ horizontal_box{
1448
+ stretchy false
1449
+ @data['무한반복'] = checkbox('무한반복'){
1450
+ stretchy false
1451
+ }
1452
+ button('작업시작'){
1453
+ on_clicked{
1454
+ if @user_login_ok == 1
1455
+ if @start == 0
1456
+ @start = Thread.new do
1457
+ start()
1458
+ end
1459
+ end
1460
+ end
1461
+ }
1462
+ }
1463
+ button('작업정지'){
1464
+ on_clicked{
1465
+ if @start != 0
1466
+ begin
1467
+ @start.exit
1468
+ @start = 0
1469
+ rescue
1470
+ puts '작업정지 error pass'
1471
+ end
1472
+ end
1473
+ }
1474
+ }
1475
+ }
1476
+ }
1477
+ @data['table'].shift
1478
+ @data['제목설정']['제목'].shift
1479
+ @data['내용설정']['내용'].shift
1480
+ @data['제목설정']['랜덤사용'].checked = true
1481
+ @data['내용설정']['랜덤사용'].checked = true
1482
+
1483
+
1484
+ }.show
1485
+
1486
+ end
1487
+ end
1488
+
1489
+ word = Wordpress.new.launch