tg_send_zon 0.0.29 → 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.
- checksums.yaml +4 -4
- data/lib/tg_send_zon.rb +38 -121
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8a1c820f09cf8a79b312b318db302449a039a333c11ff5bfe2ee51863bfb569b
|
4
|
+
data.tar.gz: d15f594f4604ed61b7d5690345a69699b2bd21547375c85ec59db968e4a20dd2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e0dbbdb623c06f2e1bcf231dee3399e95c130d7f558c103e0d641974e3a7a8bcd5688d49d99a9c99008e6a9ad62bc4040e071a3c25c8df0992156b357732d4b6
|
7
|
+
data.tar.gz: 2263369151a359d50f5e51893f04a8af6c28573e63c1d4e5aa005ad08ff0a0944d3e695dbf6c78b66933914328f1b545f799260b1342fb90a0cd65a31903d0ed
|
data/lib/tg_send_zon.rb
CHANGED
@@ -153,9 +153,9 @@ class Naver
|
|
153
153
|
|
154
154
|
|
155
155
|
chrome_start(proxy, telegram_number)
|
156
|
-
@driver.manage.window.resize_to(1000,
|
157
|
-
sleep(1)
|
158
|
-
|
156
|
+
@driver.manage.window.resize_to(1000, 800)
|
157
|
+
#sleep(1)
|
158
|
+
|
159
159
|
|
160
160
|
|
161
161
|
begin
|
@@ -261,100 +261,50 @@ class Naver
|
|
261
261
|
|
262
262
|
@nomber = nomber
|
263
263
|
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
################################################################################ 프로그램에 설정한 글만 등록
|
282
|
-
if option['세팅내용발송1'] == 'true'
|
283
|
-
|
284
|
-
wait = Selenium::WebDriver::Wait.new(:timeout => 5)
|
285
|
-
#요소가 나타날 때까지 3초 동안 기다립니다.
|
286
|
-
wait.until { @driver.find_element(:xpath, '//*[@id="telegram-search-input"]') }
|
287
|
-
|
288
|
-
#@driver.find_element(:xpath, '//*[@id="telegram-search-input"]').send_keys(url)
|
289
|
-
@driver.find_element(:xpath, '//*[@id="telegram-search-input"]').click
|
290
|
-
sleep(1)
|
291
|
-
@url = url
|
292
|
-
Clipboard.copy(url)
|
293
|
-
@driver.action.key_down(:control).send_keys('v').key_up(:control).perform
|
294
|
-
sleep(1)
|
295
|
-
|
296
|
-
|
297
|
-
#################### 예외 1 ######################
|
264
|
+
@driver.get (url)
|
265
|
+
sleep(2)
|
266
|
+
@driver.switch_to.window(@driver.window_handle)
|
267
|
+
key_stroke('escape')
|
268
|
+
|
298
269
|
begin
|
299
270
|
wait = Selenium::WebDriver::Wait.new(:timeout => 3)
|
300
271
|
#요소가 나타날 때까지 3초 동안 기다립니다.
|
301
|
-
wait.until { @driver.find_element(:xpath, '//*[@class="
|
302
|
-
|
303
|
-
rescue
|
304
|
-
puts "#{url} [발송 실패 !! 그룹이 존재하지 않습니다!!]".red
|
305
|
-
@driver.close
|
306
|
-
end
|
307
|
-
begin
|
308
|
-
@driver.find_element(:xpath, '//*[@class="search-section"]')
|
309
|
-
rescue => e
|
310
|
-
# 예외
|
272
|
+
wait.until { @driver.find_element(:xpath, '//*[@class="tgme_action_button_label"]') }
|
273
|
+
@driver.find_element(:xpath, '//*[@class="tgme_action_button_label"]').click
|
274
|
+
rescue
|
311
275
|
@driver.close
|
312
|
-
|
313
|
-
|
314
|
-
#################### 예외 1 ######################
|
315
|
-
|
316
|
-
@driver.action.key_down(:enter).key_up(:enter).perform #엔터
|
317
|
-
#sleep(1)
|
276
|
+
end
|
277
|
+
|
318
278
|
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
#요소가 나타날 때까지 3초 동안 기다립니다.
|
323
|
-
wait.until { @driver.find_element(:xpath, '//*[@class="Button close-button smaller translucent round"]') }
|
324
|
-
sleep(1)
|
325
|
-
@driver.find_element(:xpath, '//*[@class="Button close-button smaller translucent round"]').click
|
279
|
+
################################################################################ 프로그램에 설정한 글만 등록
|
280
|
+
if option['세팅내용발송1'] == 'true'
|
281
|
+
|
326
282
|
sleep(1)
|
327
|
-
|
328
|
-
|
329
|
-
|
283
|
+
@driver.execute_script("document.body.style.zoom = '50%'")
|
284
|
+
|
285
|
+
|
330
286
|
|
331
287
|
|
332
288
|
#################### 예외 2 ######################
|
333
289
|
begin
|
334
|
-
wait = Selenium::WebDriver::Wait.new(:timeout =>
|
290
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 5)
|
335
291
|
#요소가 나타날 때까지 3초 동안 기다립니다.
|
336
292
|
wait.until { @driver.find_element(:xpath, '//*[@id="editable-message-text"]') }
|
337
|
-
@driver.
|
293
|
+
@driver.execute_script("document.getElementById('editable-message-text').innerText = ''") #기존 내용 이력이 있으면 삭제
|
338
294
|
sleep(1)
|
339
|
-
rescue
|
295
|
+
rescue => e
|
340
296
|
puts "#{url} [발송 실패 !! 그룹에 가입되지 않았거나 발송 권한이 없습니다!!]".red
|
341
297
|
@driver.close
|
298
|
+
return 0
|
342
299
|
|
343
300
|
end
|
344
|
-
|
345
|
-
@driver.find_element(:xpath, '//*[@id="editable-message-text"]')
|
346
|
-
rescue => e
|
347
|
-
# 예외
|
348
|
-
@driver.close
|
349
|
-
return 0
|
350
|
-
end
|
301
|
+
|
351
302
|
#################### 예외 2 ######################
|
352
303
|
|
353
304
|
|
354
305
|
################### 내용 입력 ####################
|
355
|
-
@driver.execute_script("document.getElementById('editable-message-text').innerText = ''") #기존 내용 이력이 있으면 삭제
|
356
|
-
sleep(1)
|
357
306
|
|
307
|
+
@driver.find_element(:xpath, '//*[@id="editable-message-text"]').click
|
358
308
|
sleep(1)
|
359
309
|
@content = content
|
360
310
|
Clipboard.copy(content)
|
@@ -365,7 +315,6 @@ class Naver
|
|
365
315
|
|
366
316
|
################### 회차 옵션 ####################
|
367
317
|
if option['발송횟수추가'] == 'true'
|
368
|
-
puts '회수 추가.......'.green
|
369
318
|
@driver.action.key_down(:shift).key_down(:enter).perform
|
370
319
|
@driver.action.key_up(:shift).key_up(:enter).perform
|
371
320
|
@driver.action.key_down(:shift).key_down(:enter).perform
|
@@ -444,53 +393,22 @@ class Naver
|
|
444
393
|
################################################################################ 프로그램에 설정한 이미지랑 글까지 등록
|
445
394
|
if option['세팅내용발송2'] == 'true'
|
446
395
|
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
#@driver.find_element(:xpath, '//*[@id="telegram-search-input"]').send_keys(url)
|
452
|
-
@driver.find_element(:xpath, '//*[@id="telegram-search-input"]').click
|
453
|
-
sleep(1)
|
454
|
-
@url = url
|
455
|
-
Clipboard.copy(url)
|
456
|
-
@driver.action.key_down(:control).send_keys('v').key_up(:control).perform
|
457
|
-
sleep(1)
|
458
|
-
|
459
|
-
#################### 예외 1 ######################
|
396
|
+
sleep(1)
|
397
|
+
@driver.execute_script("document.body.style.zoom = '50%'")
|
398
|
+
|
399
|
+
|
460
400
|
begin
|
461
|
-
wait = Selenium::WebDriver::Wait.new(:timeout =>
|
401
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 5)
|
462
402
|
#요소가 나타날 때까지 3초 동안 기다립니다.
|
463
|
-
wait.until { @driver.find_element(:xpath, '//*[@
|
403
|
+
wait.until { @driver.find_element(:xpath, '//*[@id="editable-message-text"]') }
|
404
|
+
@driver.execute_script("document.getElementById('editable-message-text').innerText = ''") #기존 내용 이력이 있으면 삭제
|
464
405
|
sleep(1)
|
465
|
-
rescue
|
466
|
-
puts
|
467
|
-
|
468
|
-
end
|
469
|
-
begin
|
470
|
-
@driver.find_element(:xpath, '//*[@class="search-section"]')
|
471
|
-
rescue => e
|
472
|
-
# 예외
|
406
|
+
rescue
|
407
|
+
#puts url + ' [그룹에 가입되지 않았거나 발송 권한이 없습니다]'.red
|
408
|
+
puts "#{url} [발송 실패 !! 그룹에 가입되지 않았거나 발송 권한이 없습니다!!]".red
|
473
409
|
@driver.close
|
474
|
-
return 0
|
475
|
-
end
|
476
|
-
#################### 예외 1 ######################
|
477
|
-
@driver.action.key_down(:enter).key_up(:enter).perform #엔터
|
478
|
-
#sleep(1)
|
479
|
-
|
480
|
-
########### 그룹 정보 가 나와있으면 닫기 ###########
|
481
|
-
begin
|
482
|
-
wait = Selenium::WebDriver::Wait.new(:timeout => 1.5)
|
483
|
-
#요소가 나타날 때까지 3초 동안 기다립니다.
|
484
|
-
wait.until { @driver.find_element(:xpath, '//*[@class="Button close-button smaller translucent round"]') }
|
485
|
-
sleep(1)
|
486
|
-
@driver.find_element(:xpath, '//*[@class="Button close-button smaller translucent round"]').click
|
487
|
-
sleep(1)
|
488
|
-
rescue
|
489
|
-
end
|
490
|
-
########### 그룹 정보 가 나와있으면 닫기 ###########
|
491
410
|
|
492
|
-
|
493
|
-
sleep(1)
|
411
|
+
end
|
494
412
|
|
495
413
|
#################### 예외 2 ######################
|
496
414
|
begin
|
@@ -561,7 +479,6 @@ class Naver
|
|
561
479
|
|
562
480
|
################### 회차 옵션 ####################
|
563
481
|
if option['발송횟수추가'] == 'true'
|
564
|
-
puts '회수 추가.......'.green
|
565
482
|
@driver.action.key_down(:shift).key_down(:enter).perform
|
566
483
|
@driver.action.key_up(:shift).key_up(:enter).perform
|
567
484
|
@driver.action.key_down(:shift).key_down(:enter).perform
|
@@ -633,8 +550,8 @@ class Naver
|
|
633
550
|
|
634
551
|
|
635
552
|
begin
|
636
|
-
puts "#{url} [발송 완료 !!]".cyan
|
637
|
-
|
553
|
+
puts "#{url} [#{nomber}회차] [발송 완료 !!]".cyan
|
554
|
+
|
638
555
|
rescue
|
639
556
|
|
640
557
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tg_send_zon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.30
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- zon
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-12-
|
11
|
+
date: 2024-12-16 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: File to Clipboard gem
|
14
14
|
email: mymin26@naver.com
|