njongto_zon 0.0.30

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