duo_blog_cafe_comment 0.0.7 → 0.0.10
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_cafe_comment.rb +57 -47
- 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: 3dc7f6ba6bf321fcf4c1b647f869eddb6383ea2c747b7ab3dc9e1a99026d9c5b
|
4
|
+
data.tar.gz: 7b6a251ffeb311416ef8892aff6e232f926aa17aba8ad96a9e55e2fa3e901582
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a9f9b3c05542f619cac2b15231bce8e9d094a37aa33783033289b1e9e8e2aa1a1d16da6bbd3e2543e23be89884851e8c6af074e1cd41d685327b9f08e0b32922
|
7
|
+
data.tar.gz: b93871d5659b2c397c4aa9834ba0643024c69440d0f5753127622ad89a8aa8bb6ef38ccae070793b682cec3607fda517b17bbfaa7c6e4477283a06d6326ab87b
|
@@ -50,9 +50,17 @@ class Naver
|
|
50
50
|
options.add_argument('--disable-gpu')
|
51
51
|
options.add_argument('--remote-debugging-port=9222')
|
52
52
|
options.add_argument('user-data-dir=C:/naver_cookie/' + user_id)
|
53
|
-
|
54
|
-
|
55
|
-
|
53
|
+
# 'capabilities'과 'options' 배열로 설정
|
54
|
+
capabilities = Selenium::WebDriver::Remote::Capabilities.chrome
|
55
|
+
capabilities["goog:chromeOptions"] = options.as_json
|
56
|
+
|
57
|
+
# Selenium 4에서는 'capabilities'만 사용하는 방식
|
58
|
+
@driver = Selenium::WebDriver.for(:chrome, capabilities: [capabilities, options])
|
59
|
+
|
60
|
+
@driver.execute_script("Object.defineProperty(navigator, 'webdriver', {get: function(){ return false; }});") # 셀레니움 감지 방지
|
61
|
+
|
62
|
+
rescue => e
|
63
|
+
@driver = Selenium::WebDriver.for(:chrome, capabilities: [capabilities, options])
|
56
64
|
end
|
57
65
|
else
|
58
66
|
begin
|
@@ -68,7 +76,14 @@ class Naver
|
|
68
76
|
options.add_argument('--disable-gpu')
|
69
77
|
options.add_argument('--remote-debugging-port=9222')
|
70
78
|
options.add_argument('user-data-dir=C:/naver_cookie/' + user_id)
|
71
|
-
|
79
|
+
# 'capabilities'과 'options' 배열로 설정
|
80
|
+
capabilities = Selenium::WebDriver::Remote::Capabilities.chrome
|
81
|
+
capabilities["goog:chromeOptions"] = options.as_json
|
82
|
+
|
83
|
+
# Selenium 4에서는 'capabilities'만 사용하는 방식
|
84
|
+
@driver = Selenium::WebDriver.for(:chrome, capabilities: [capabilities, options])
|
85
|
+
|
86
|
+
@driver.execute_script("Object.defineProperty(navigator, 'webdriver', {get: function(){ return false; }});") # 셀레니움 감지 방지
|
72
87
|
rescue => e
|
73
88
|
puts e
|
74
89
|
puts 'proxy error...'
|
@@ -84,9 +99,16 @@ class Naver
|
|
84
99
|
options.add_argument('--disable-gpu')
|
85
100
|
options.add_argument('--remote-debugging-port=9222')
|
86
101
|
options.add_argument('user-data-dir=C:/naver_cookie/' + user_id)
|
87
|
-
|
102
|
+
# 'capabilities'과 'options' 배열로 설정
|
103
|
+
capabilities = Selenium::WebDriver::Remote::Capabilities.chrome
|
104
|
+
capabilities["goog:chromeOptions"] = options.as_json
|
105
|
+
|
106
|
+
# Selenium 4에서는 'capabilities'만 사용하는 방식
|
107
|
+
@driver = Selenium::WebDriver.for(:chrome, capabilities: [capabilities, options])
|
108
|
+
|
109
|
+
@driver.execute_script("Object.defineProperty(navigator, 'webdriver', {get: function(){ return false; }});") # 셀레니움 감지 방지
|
88
110
|
rescue
|
89
|
-
@driver = Selenium::WebDriver.for(:chrome,
|
111
|
+
@driver = Selenium::WebDriver.for(:chrome, capabilities: [capabilities, options])
|
90
112
|
end
|
91
113
|
end
|
92
114
|
end
|
@@ -94,6 +116,7 @@ class Naver
|
|
94
116
|
|
95
117
|
|
96
118
|
|
119
|
+
|
97
120
|
def login(user_id, user_pw, proxy)
|
98
121
|
@user_id = user_id
|
99
122
|
@user_id11 = user_id
|
@@ -2050,56 +2073,43 @@ class Wordpress
|
|
2050
2073
|
|
2051
2074
|
# ADB 서버 초기화
|
2052
2075
|
puts 'adb kill-server'
|
2053
|
-
Open3.capture3('adb kill-server')
|
2054
|
-
sleep(
|
2076
|
+
Open3.capture3('./adb kill-server')
|
2077
|
+
sleep(3)
|
2055
2078
|
|
2056
2079
|
# 다시 ADB 서버 실행
|
2057
2080
|
puts 'adb start-server'
|
2058
|
-
Open3.capture3('adb start-server')
|
2059
|
-
sleep(
|
2081
|
+
Open3.capture3('./adb start-server')
|
2082
|
+
sleep(3)
|
2060
2083
|
|
2061
2084
|
# 데이터를 끄고 켜기
|
2062
2085
|
puts 'adb -s ' + device_id + ' shell svc data disable'
|
2063
|
-
stdout2, stderr2, status2 = Open3.capture3('./adb -s '
|
2064
|
-
|
2065
|
-
|
2066
|
-
|
2067
|
-
|
2068
|
-
|
2069
|
-
|
2070
|
-
|
2071
|
-
|
2072
|
-
|
2073
|
-
|
2074
|
-
|
2075
|
-
|
2076
|
-
|
2077
|
-
|
2078
|
-
|
2079
|
-
|
2080
|
-
|
2081
|
-
|
2082
|
-
@my_ip = new_ip
|
2083
|
-
puts "IP 변경됨: #{@my_ip}"
|
2084
|
-
break # IP가 변경되었으면 루프 종료
|
2085
|
-
else
|
2086
|
-
puts 'IP가 변경되지 않음. 재시도...'
|
2087
|
-
sleep(3) # 3초 후 재시도
|
2088
|
-
end
|
2089
|
-
rescue => e
|
2090
|
-
puts "IP 확인 중 오류 발생: #{e.message}. 재시도 중..."
|
2091
|
-
sleep(3) # 3초 후 재시도
|
2092
|
-
end
|
2093
|
-
end
|
2086
|
+
stdout2, stderr2, status2 = Open3.capture3('./adb -s '+device_id+' shell svc data disable')
|
2087
|
+
sleep(3)
|
2088
|
+
puts 'adb -s ' + device_id + ' shell svc data enable'
|
2089
|
+
Open3.capture3('./adb -s '+device_id+' shell svc data enable')
|
2090
|
+
sleep(3)
|
2091
|
+
puts 'adb ok'
|
2092
|
+
sleep(8)
|
2093
|
+
|
2094
|
+
robot_ip = lambda do
|
2095
|
+
http = HTTP.get('https://www.findip.kr/')
|
2096
|
+
noko = Nokogiri::HTML(http.to_s)
|
2097
|
+
if noko.xpath('/html/body/header/h2').text != @my_ip
|
2098
|
+
@my_ip = noko.xpath('/html/body/header/h2').text
|
2099
|
+
puts "IP 변경됨[ #{@my_ip} ]"
|
2100
|
+
else
|
2101
|
+
puts @my_ip
|
2102
|
+
puts '제시도...'
|
2103
|
+
sleep(3)
|
2104
|
+
robot_ip[]
|
2094
2105
|
end
|
2095
|
-
|
2096
|
-
|
2097
|
-
|
2098
|
-
end
|
2106
|
+
end
|
2107
|
+
robot_ip[]
|
2108
|
+
|
2099
2109
|
else
|
2100
|
-
|
2110
|
+
puts 'adb error pass'
|
2101
2111
|
end
|
2102
|
-
|
2112
|
+
end
|
2103
2113
|
|
2104
2114
|
|
2105
2115
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: duo_blog_cafe_comment
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- zon
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-02-
|
11
|
+
date: 2025-02-11 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: File to Clipboard gem
|
14
14
|
email: mymin26@naver.com
|