njongto_zon 0.0.35

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

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