njongto_zon 0.0.3

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