tg_send_duo 0.0.27 → 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_duo.rb +51 -135
- 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: be8a23b8df9c2f1bef69a12e142f0bdcf7f95404f3cd4d632d0ca4e56db15826
|
4
|
+
data.tar.gz: ebc737bb08e35e185390e5d34fd227d8e4e30d4b8a3f19a24f6fceeae470027b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 30352a8fa4c39400f07655d9145e0b87cc73aa60e6616f4a221dd273c64163287653be3dc7fa576853cda9aa276f26d7ce5bfd2cb7c6f7447928e276bf3018ba
|
7
|
+
data.tar.gz: ce63709cfbf785dc3c8bb3cf4aee7af7bab71b6a5cbc699cbca15bab28c1e2f394a9673c917044995e306c77df319f9a00a584a77ce1ee857948210955c5e117
|
data/lib/tg_send_duo.rb
CHANGED
@@ -138,24 +138,24 @@ class Naver
|
|
138
138
|
current_dir = File.dirname(__FILE__)
|
139
139
|
telegram_cookie_dir = "C:/telegram_cookie"
|
140
140
|
FileUtils.mkdir_p(telegram_cookie_dir) unless File.exist?(telegram_cookie_dir)
|
141
|
-
|
141
|
+
|
142
142
|
unless File.exist?("C:/telegram_cookie/" + telegram_number)
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
end
|
143
|
+
tdriver_src = File.join(current_dir, 'tdriver')
|
144
|
+
if Dir.exist?(tdriver_src)
|
145
|
+
FileUtils.cp_r(tdriver_src, "C:/telegram_cookie/" + telegram_number)
|
146
|
+
|
148
147
|
end
|
149
|
-
|
148
|
+
end
|
149
|
+
|
150
150
|
# 새로운 스레드 생성 및 실행
|
151
151
|
Thread.new { chrome_setup(telegram_number) }
|
152
152
|
sleep(1)
|
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
|
@@ -164,7 +164,7 @@ class Naver
|
|
164
164
|
wait.until { @driver.find_element(:xpath, '//*[@title="Open menu"]') }
|
165
165
|
check_cookie_login = 1
|
166
166
|
# puts'계정 세션 확인!! 로그인 skip.......'.yellow
|
167
|
-
|
167
|
+
|
168
168
|
|
169
169
|
rescue
|
170
170
|
|
@@ -261,101 +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)
|
318
|
-
|
276
|
+
end
|
277
|
+
|
319
278
|
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
#요소가 나타날 때까지 3초 동안 기다립니다.
|
324
|
-
wait.until { @driver.find_element(:xpath, '//*[@class="Button close-button smaller translucent round"]') }
|
325
|
-
sleep(1)
|
326
|
-
@driver.find_element(:xpath, '//*[@class="Button close-button smaller translucent round"]').click
|
279
|
+
################################################################################ 프로그램에 설정한 글만 등록
|
280
|
+
if option['세팅내용발송1'] == 'true'
|
281
|
+
|
327
282
|
sleep(1)
|
328
|
-
|
329
|
-
|
330
|
-
|
283
|
+
@driver.execute_script("document.body.style.zoom = '50%'")
|
284
|
+
|
285
|
+
|
331
286
|
|
332
287
|
|
333
288
|
#################### 예외 2 ######################
|
334
289
|
begin
|
335
|
-
wait = Selenium::WebDriver::Wait.new(:timeout =>
|
290
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 5)
|
336
291
|
#요소가 나타날 때까지 3초 동안 기다립니다.
|
337
292
|
wait.until { @driver.find_element(:xpath, '//*[@id="editable-message-text"]') }
|
338
|
-
@driver.
|
293
|
+
@driver.execute_script("document.getElementById('editable-message-text').innerText = ''") #기존 내용 이력이 있으면 삭제
|
339
294
|
sleep(1)
|
340
|
-
rescue
|
295
|
+
rescue => e
|
341
296
|
puts "#{url} [발송 실패 !! 그룹에 가입되지 않았거나 발송 권한이 없습니다!!]".red
|
342
297
|
@driver.close
|
298
|
+
return 0
|
343
299
|
|
344
300
|
end
|
345
|
-
|
346
|
-
@driver.find_element(:xpath, '//*[@id="editable-message-text"]')
|
347
|
-
rescue => e
|
348
|
-
# 예외
|
349
|
-
@driver.close
|
350
|
-
return 0
|
351
|
-
end
|
301
|
+
|
352
302
|
#################### 예외 2 ######################
|
353
303
|
|
354
304
|
|
355
305
|
################### 내용 입력 ####################
|
356
|
-
@driver.execute_script("document.getElementById('editable-message-text').innerText = ''") #기존 내용 이력이 있으면 삭제
|
357
|
-
sleep(1)
|
358
306
|
|
307
|
+
@driver.find_element(:xpath, '//*[@id="editable-message-text"]').click
|
359
308
|
sleep(1)
|
360
309
|
@content = content
|
361
310
|
Clipboard.copy(content)
|
@@ -366,7 +315,6 @@ class Naver
|
|
366
315
|
|
367
316
|
################### 회차 옵션 ####################
|
368
317
|
if option['발송횟수추가'] == 'true'
|
369
|
-
puts '회수 추가.......'.green
|
370
318
|
@driver.action.key_down(:shift).key_down(:enter).perform
|
371
319
|
@driver.action.key_up(:shift).key_up(:enter).perform
|
372
320
|
@driver.action.key_down(:shift).key_down(:enter).perform
|
@@ -445,53 +393,22 @@ class Naver
|
|
445
393
|
################################################################################ 프로그램에 설정한 이미지랑 글까지 등록
|
446
394
|
if option['세팅내용발송2'] == 'true'
|
447
395
|
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
#@driver.find_element(:xpath, '//*[@id="telegram-search-input"]').send_keys(url)
|
453
|
-
@driver.find_element(:xpath, '//*[@id="telegram-search-input"]').click
|
454
|
-
sleep(1)
|
455
|
-
@url = url
|
456
|
-
Clipboard.copy(url)
|
457
|
-
@driver.action.key_down(:control).send_keys('v').key_up(:control).perform
|
458
|
-
sleep(1)
|
459
|
-
|
460
|
-
#################### 예외 1 ######################
|
396
|
+
sleep(1)
|
397
|
+
@driver.execute_script("document.body.style.zoom = '50%'")
|
398
|
+
|
399
|
+
|
461
400
|
begin
|
462
|
-
wait = Selenium::WebDriver::Wait.new(:timeout =>
|
401
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 5)
|
463
402
|
#요소가 나타날 때까지 3초 동안 기다립니다.
|
464
|
-
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 = ''") #기존 내용 이력이 있으면 삭제
|
465
405
|
sleep(1)
|
466
|
-
rescue
|
467
|
-
puts
|
468
|
-
|
469
|
-
end
|
470
|
-
begin
|
471
|
-
@driver.find_element(:xpath, '//*[@class="search-section"]')
|
472
|
-
rescue => e
|
473
|
-
# 예외
|
406
|
+
rescue
|
407
|
+
#puts url + ' [그룹에 가입되지 않았거나 발송 권한이 없습니다]'.red
|
408
|
+
puts "#{url} [발송 실패 !! 그룹에 가입되지 않았거나 발송 권한이 없습니다!!]".red
|
474
409
|
@driver.close
|
475
|
-
return 0
|
476
|
-
end
|
477
|
-
#################### 예외 1 ######################
|
478
|
-
@driver.action.key_down(:enter).key_up(:enter).perform #엔터
|
479
|
-
#sleep(1)
|
480
|
-
|
481
|
-
########### 그룹 정보 가 나와있으면 닫기 ###########
|
482
|
-
begin
|
483
|
-
wait = Selenium::WebDriver::Wait.new(:timeout => 1.5)
|
484
|
-
#요소가 나타날 때까지 3초 동안 기다립니다.
|
485
|
-
wait.until { @driver.find_element(:xpath, '//*[@class="Button close-button smaller translucent round"]') }
|
486
|
-
sleep(1)
|
487
|
-
@driver.find_element(:xpath, '//*[@class="Button close-button smaller translucent round"]').click
|
488
|
-
sleep(1)
|
489
|
-
rescue
|
490
|
-
end
|
491
|
-
########### 그룹 정보 가 나와있으면 닫기 ###########
|
492
410
|
|
493
|
-
|
494
|
-
sleep(1)
|
411
|
+
end
|
495
412
|
|
496
413
|
#################### 예외 2 ######################
|
497
414
|
begin
|
@@ -562,7 +479,6 @@ class Naver
|
|
562
479
|
|
563
480
|
################### 회차 옵션 ####################
|
564
481
|
if option['발송횟수추가'] == 'true'
|
565
|
-
puts '회수 추가.......'.green
|
566
482
|
@driver.action.key_down(:shift).key_down(:enter).perform
|
567
483
|
@driver.action.key_up(:shift).key_up(:enter).perform
|
568
484
|
@driver.action.key_down(:shift).key_down(:enter).perform
|
@@ -589,7 +505,7 @@ class Naver
|
|
589
505
|
@driver.close
|
590
506
|
rescue
|
591
507
|
end
|
592
|
-
|
508
|
+
|
593
509
|
begin
|
594
510
|
# 예외
|
595
511
|
@driver.find_element(:xpath, '//*[@class="Button tiny translucent round"]')
|
@@ -634,8 +550,8 @@ class Naver
|
|
634
550
|
|
635
551
|
|
636
552
|
begin
|
637
|
-
puts "#{url} [발송 완료 !!]".cyan
|
638
|
-
|
553
|
+
puts "#{url} [#{nomber}회차] [발송 완료 !!]".cyan
|
554
|
+
|
639
555
|
rescue
|
640
556
|
|
641
557
|
end
|
@@ -1230,7 +1146,7 @@ class Wordpress
|
|
1230
1146
|
stretchy false
|
1231
1147
|
grid{
|
1232
1148
|
@data['group_list'] = entry{
|
1233
|
-
text 'ex)
|
1149
|
+
text 'ex) abc123'
|
1234
1150
|
top 0
|
1235
1151
|
left 0
|
1236
1152
|
}
|
@@ -1238,7 +1154,7 @@ class Wordpress
|
|
1238
1154
|
|
1239
1155
|
|
1240
1156
|
|
1241
|
-
button('
|
1157
|
+
button(' 그룹방 ID 등록하기 '){
|
1242
1158
|
top 0
|
1243
1159
|
left 1
|
1244
1160
|
on_clicked {
|
@@ -1247,7 +1163,7 @@ class Wordpress
|
|
1247
1163
|
@data['table'].pop
|
1248
1164
|
}
|
1249
1165
|
}
|
1250
|
-
button('그룹
|
1166
|
+
button('그룹 list 불러오기 ') {
|
1251
1167
|
top 0
|
1252
1168
|
left 2
|
1253
1169
|
on_clicked {
|
@@ -1355,7 +1271,7 @@ class Wordpress
|
|
1355
1271
|
editable true
|
1356
1272
|
}
|
1357
1273
|
|
1358
|
-
text_column('
|
1274
|
+
text_column('그룹방 LIST'){
|
1359
1275
|
editable true
|
1360
1276
|
|
1361
1277
|
}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tg_send_duo
|
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
|