duo_blog_comment 0.0.39 → 0.0.53
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/duo_blog_comment.rb +56 -39
- 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: d08cf158a1b95e0364f258642affc598dc2235ab0d45868895057224dcc25d09
|
4
|
+
data.tar.gz: 87541b922b752af42c2c44d5c56fbd23982cc381ee4d851021923c3903edac96
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bf9aa6bb95782f59044e9710a12755db01c387b8307fe0a4e67afb105c32eb3c228bdd9cb44f1ba98717d1c38218260cafae89a19e09e975005bb7bab725cbd4
|
7
|
+
data.tar.gz: c4546f1764f8a9935833ee73ded15fe06447597f992027ecd18144228559c5619831f3663ee3717b477f34474aeefbb985f778e7b73682cf9083ecbfdbb1b46c
|
data/lib/duo_blog_comment.rb
CHANGED
@@ -16,48 +16,17 @@ require 'uri'
|
|
16
16
|
require 'cgi'
|
17
17
|
require 'auto_click'
|
18
18
|
require 'rainbow/refinement'
|
19
|
-
require 'win32ole'
|
20
19
|
include AutoClickMethods
|
21
20
|
using Rainbow
|
22
21
|
include Glimmer
|
23
22
|
|
24
23
|
|
25
24
|
class Naver
|
26
|
-
def initialize
|
27
|
-
|
28
|
-
sleep(1)
|
25
|
+
def initialize(data)
|
26
|
+
@data = data
|
29
27
|
@seed = 1
|
30
28
|
end
|
31
29
|
|
32
|
-
def kill_selenium_chrome #기존 창 모두 닫는 코드
|
33
|
-
wmi = WIN32OLE.connect("winmgmts://")
|
34
|
-
chrome_procs = wmi.ExecQuery("SELECT * FROM Win32_Process WHERE Name = 'chrome.exe'")
|
35
|
-
|
36
|
-
chrome_procs.each do |proc|
|
37
|
-
cmd = proc.CommandLine
|
38
|
-
if cmd && cmd.include?("user-data-dir=C:/naver_cookie")
|
39
|
-
puts "→ 크롬 창 초기화: PID #{proc.ProcessId}"
|
40
|
-
begin
|
41
|
-
proc.Terminate
|
42
|
-
rescue
|
43
|
-
#puts "→ 이미 종료된 프로세스: #{proc.ProcessId}"
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
# chromedriver도 같이 종료
|
49
|
-
chromedrivers = wmi.ExecQuery("SELECT * FROM Win32_Process WHERE Name = 'chromedriver.exe'")
|
50
|
-
chromedrivers.each do |proc|
|
51
|
-
puts "→ 크롬 창 초기화: PID #{proc.ProcessId}"
|
52
|
-
begin
|
53
|
-
proc.Terminate
|
54
|
-
rescue
|
55
|
-
#puts "→ 이미 종료된 chromedriver: #{proc.ProcessId}"
|
56
|
-
end
|
57
|
-
end
|
58
|
-
end
|
59
|
-
|
60
|
-
|
61
30
|
def chrome_setup(user_id, proxy)
|
62
31
|
naver_cookie_dir = "C:/naver_cookie"
|
63
32
|
FileUtils.mkdir_p(naver_cookie_dir) unless File.exist?(naver_cookie_dir)
|
@@ -306,12 +275,13 @@ class Naver
|
|
306
275
|
|
307
276
|
|
308
277
|
|
309
|
-
def update(content,image,option,counts_number,keyword,blog_url,api_key,
|
278
|
+
def update(content,image,option,counts_number,keyword,blog_url,api_key,sleep_delay)
|
310
279
|
|
311
280
|
@keyword = keyword
|
312
281
|
@content = content
|
313
282
|
@api_key = api_key
|
314
283
|
@blog_url = blog_url
|
284
|
+
@sleep_delay = sleep_delay
|
315
285
|
#sleep(counts_delay)
|
316
286
|
|
317
287
|
|
@@ -693,7 +663,12 @@ class Naver
|
|
693
663
|
wait.until { @driver.find_element(:xpath, '//*[@id="mainFrame"]') } # 아이프레임 선택
|
694
664
|
sleep(1)
|
695
665
|
@driver.switch_to.frame(@driver.find_element(:xpath, '//*[@id="mainFrame"]')) # 아이프레임 선택
|
696
|
-
sleep(1)
|
666
|
+
sleep(1)
|
667
|
+
puts "게시글 읽는 모션 진행".yellow
|
668
|
+
@driver.action.send_keys(:page_down).perform #스크롤 내리기
|
669
|
+
sleep(1)
|
670
|
+
@driver.action.send_keys(:page_down).perform #스크롤 내리기
|
671
|
+
sleep(1)
|
697
672
|
|
698
673
|
if option['이웃추가'] == 'true'
|
699
674
|
begin
|
@@ -1082,6 +1057,36 @@ class Naver
|
|
1082
1057
|
else
|
1083
1058
|
end
|
1084
1059
|
|
1060
|
+
content_soon = 0
|
1061
|
+
# 💬 content 설정 (여기 추가!)
|
1062
|
+
if @data['내용설정']['내용'].nil? || @data['내용설정']['내용'].empty?
|
1063
|
+
content = ''
|
1064
|
+
else
|
1065
|
+
if @data.dig('내용설정', '랜덤사용')&.respond_to?(:checked?) && @data['내용설정']['랜덤사용'].checked?
|
1066
|
+
content = @data['내용설정']['내용'].sample[2] # 랜덤 사용 시
|
1067
|
+
else
|
1068
|
+
content = @data['내용설정']['내용'][content_soon][2] # 순차적으로 사용
|
1069
|
+
content_soon += 1
|
1070
|
+
if content_soon >= @data['내용설정']['내용'].length
|
1071
|
+
content_soon = 0
|
1072
|
+
end
|
1073
|
+
end
|
1074
|
+
end
|
1075
|
+
|
1076
|
+
# 디엠 자동 변경이 체크된 경우 content를 변환
|
1077
|
+
if @data['포스트설정']['내용자동변경'].checked?
|
1078
|
+
change_memory = {}
|
1079
|
+
@data['포스트설정']['내용자동변경값'].each do |key, v|
|
1080
|
+
change_memory[key] = v.sample
|
1081
|
+
end
|
1082
|
+
@data['포스트설정']['내용자동변경값'].each do |key, _|
|
1083
|
+
if content.include?(key)
|
1084
|
+
content = content.gsub(key, change_memory[key]) # gsub을 사용하여 내용 치환
|
1085
|
+
else
|
1086
|
+
end
|
1087
|
+
end
|
1088
|
+
end
|
1089
|
+
|
1085
1090
|
begin #댓글 작업 >> 시작
|
1086
1091
|
# 댓글 쓰기 버튼 클릭
|
1087
1092
|
begin
|
@@ -1385,6 +1390,18 @@ class Naver
|
|
1385
1390
|
puts '-[√] 로그 파일 생성 완료.......'.yellow
|
1386
1391
|
end
|
1387
1392
|
end
|
1393
|
+
|
1394
|
+
def sleep_with_progress(sleep_delay)
|
1395
|
+
print "[설정 딜레이 진행 중] "
|
1396
|
+
steps = (sleep_delay.to_f / 0.5).to_i
|
1397
|
+
steps.times do
|
1398
|
+
print "."
|
1399
|
+
STDOUT.flush
|
1400
|
+
sleep(1)
|
1401
|
+
end
|
1402
|
+
puts "\n"
|
1403
|
+
end
|
1404
|
+
sleep_with_progress(sleep_delay)
|
1388
1405
|
|
1389
1406
|
rescue
|
1390
1407
|
|
@@ -1738,7 +1755,7 @@ class Wordpress
|
|
1738
1755
|
proxy = table[3].to_s
|
1739
1756
|
user_id = table[1].to_s
|
1740
1757
|
user_pw = table[2].to_s
|
1741
|
-
naver = Naver.new
|
1758
|
+
naver = Naver.new(@data)
|
1742
1759
|
@data['table'][index][-1] = 30
|
1743
1760
|
@data['table'] << []
|
1744
1761
|
@data['table'].pop
|
@@ -1923,9 +1940,9 @@ class Wordpress
|
|
1923
1940
|
|
1924
1941
|
# 댓글 설정 수 카운트
|
1925
1942
|
counts_number = @data['table'][index][6].to_i
|
1926
|
-
|
1943
|
+
sleep_delay = @data['table'][index][5].to_i
|
1927
1944
|
api_key = @data['포스트설정']['api_key'].text.to_s.force_encoding('utf-8')
|
1928
|
-
naver.update(content,image,option,counts_number,keyword,blog_url,api_key,
|
1945
|
+
naver.update(content,image,option,counts_number,keyword,blog_url,api_key,sleep_delay)
|
1929
1946
|
|
1930
1947
|
|
1931
1948
|
|
@@ -1934,7 +1951,7 @@ class Wordpress
|
|
1934
1951
|
@data['table'][index][-1] = 100
|
1935
1952
|
@data['table'] << []
|
1936
1953
|
@data['table'].pop
|
1937
|
-
sleep(@data['table'][index][5].to_i)
|
1954
|
+
#sleep(@data['table'][index][5].to_i)
|
1938
1955
|
end
|
1939
1956
|
rescue => exception
|
1940
1957
|
puts exception
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: duo_blog_comment
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.53
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- zon
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-
|
10
|
+
date: 2025-06-12 00:00:00.000000000 Z
|
11
11
|
dependencies: []
|
12
12
|
description: File to Clipboard gem
|
13
13
|
email: mymin26@naver.com
|