duo_blog_comment 0.0.62 → 0.0.63
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 +26 -36
- 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: cea993be072fe7ee86e4dfa20e17678f2113f18b19eade70f462801150e095af
|
4
|
+
data.tar.gz: e34b710e83f34a9b320eb2fc83aaa536ffb12ee39335bf726d8f87f92ae00c95
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d360d1443ef83a3443dbea743b1cde6cbd04fc142193c9b13d3049fc4767442c35b179f3a818749e6e1704280fe4ead7847e66fd2d1d25c4534ca188b6dfd943
|
7
|
+
data.tar.gz: 26fda8d6ffcd423807c5cc784fff5d9cf00e763da18b5ab0b93a6f07a30c62409fc9c056d12823a2b49fff103a689319894bca70c63fc72cfd729d0b1efd782f
|
data/lib/duo_blog_comment.rb
CHANGED
@@ -32,11 +32,11 @@ class Naver
|
|
32
32
|
FileUtils.mkdir_p(naver_cookie_dir) unless File.exist?(naver_cookie_dir)
|
33
33
|
if proxy == ''
|
34
34
|
|
35
|
-
system(%{"C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe" https://naver.com/
|
35
|
+
system(%{"C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe" https://my.naver.com/ --remote-debugging-port=9222 --user-data-dir=C:/naver_cookie/#{user_id} --no-first-run --no-default-browser-check --disable-sync})
|
36
36
|
|
37
37
|
else
|
38
38
|
|
39
|
-
system(%{"C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe" https://naver.com/
|
39
|
+
system(%{"C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe" https://my.naver.com/ --remote-debugging-port=9222 --user-data-dir=C:/naver_cookie/#{user_id} --proxy-server=#{proxy.to_s.force_encoding('utf-8').to_s} --no-first-run --no-default-browser-check --disable-sync})
|
40
40
|
|
41
41
|
end
|
42
42
|
end
|
@@ -188,60 +188,51 @@ class Naver
|
|
188
188
|
|
189
189
|
|
190
190
|
chrome_start(proxy, user_id)
|
191
|
-
|
192
|
-
puts'[Step.01] 계정 로그인 및 세션 확인.......'.yellow
|
193
|
-
|
191
|
+
|
194
192
|
|
195
193
|
sleep(1)
|
196
194
|
|
197
195
|
begin
|
198
|
-
wait = Selenium::WebDriver::Wait.new(:timeout =>
|
196
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 5)
|
199
197
|
#요소가 나타날 때까지 3초 동안 기다립니다.
|
200
|
-
wait.until { @driver.find_element(:xpath, '//*[@class="
|
198
|
+
wait.until { @driver.find_element(:xpath, '//*[@class="HeaderView_email__beGsy"]') }
|
201
199
|
sleep(1.5)
|
202
200
|
check_cookie_login = 1
|
203
|
-
puts'
|
201
|
+
puts'✅ 계정 세션 확인!! 로그인 skip.......'.yellow
|
204
202
|
sleep(2.5)
|
205
203
|
rescue
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
204
|
+
begin
|
205
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 3)
|
206
|
+
wait.until { @driver.find_element(:xpath, '//*[@class="HeaderView_login_text__pFpJ_"]') }
|
207
|
+
sleep(1.5)
|
208
|
+
@driver.find_element(:xpath, '//*[@class="HeaderView_login_text__pFpJ_"]').click
|
209
|
+
check_cookie_login = 0
|
210
|
+
sleep(1)
|
211
|
+
rescue
|
212
|
+
@driver.quit
|
213
|
+
return 0
|
214
|
+
end
|
213
215
|
end
|
214
216
|
|
215
217
|
if check_cookie_login == 0
|
216
|
-
puts'
|
218
|
+
puts'✅ 계정 세션이 없거나 기간 만료로 인해 로그인 시도.......'.yellow
|
217
219
|
# @driver.find_element(:xpath, '//*[@id="right-content-area"]/div[1]/div[1]/div/a').click
|
218
220
|
sleep(3)
|
219
221
|
begin
|
220
222
|
wait = Selenium::WebDriver::Wait.new(:timeout => 7)
|
221
223
|
#요소가 나타날 때까지 3초 동안 기다립니다.
|
222
|
-
wait.until { @driver.find_element(:xpath, '//*[@id="id"
|
223
|
-
|
224
|
+
wait.until { @driver.find_element(:xpath, '//*[@id="id"]') }
|
225
|
+
sleep(1.5)
|
226
|
+
|
227
|
+
@driver.find_element(:xpath, '//*[@id="id"]').click
|
224
228
|
Clipboard.copy(user_id)
|
225
229
|
@driver.action.key_down(:control).send_keys('v').key_up(:control).perform
|
226
230
|
sleep(1.5)
|
227
|
-
@driver.find_element(:xpath, '//*[@id="pw"
|
231
|
+
@driver.find_element(:xpath, '//*[@id="pw"]').click
|
228
232
|
Clipboard.copy(user_pw)
|
229
233
|
@driver.action.key_down(:control).send_keys('v').key_up(:control).perform
|
230
234
|
sleep(1.5)
|
231
|
-
|
232
|
-
begin
|
233
|
-
smart_level_value = @driver.find_element(id: 'smart_LEVEL').attribute('value')
|
234
|
-
if smart_level_value == '1'
|
235
|
-
@driver.find_element(xpath: '//label[@for="switch" and @class="switch_btn"]').click
|
236
|
-
sleep(1.5)
|
237
|
-
end
|
238
|
-
rescue
|
239
|
-
end
|
240
|
-
|
241
|
-
wait = Selenium::WebDriver::Wait.new(:timeout => 3)
|
242
|
-
#요소가 나타날 때까지 3초 동안 기다립니다.
|
243
|
-
wait.until { @driver.find_element(xpath: '//button[@type="submit" and @id="log.login"]') }
|
244
|
-
@driver.find_element(xpath: '//button[@type="submit" and @id="log.login"]').click
|
235
|
+
@driver.find_element(:xpath, '//*[@type="submit" and @class="btn_check next_step" and @id="submit_btn"]').click
|
245
236
|
sleep(2.5)
|
246
237
|
rescue => e
|
247
238
|
puts '-[√] 로딩 지연 접속 실패.......'.red
|
@@ -265,8 +256,7 @@ class Naver
|
|
265
256
|
begin
|
266
257
|
wait = Selenium::WebDriver::Wait.new(:timeout => 5)
|
267
258
|
#요소가 나타날 때까지 3초 동안 기다립니다.
|
268
|
-
wait.until { @driver.find_element(:xpath, '//*[@
|
269
|
-
|
259
|
+
wait.until { @driver.find_element(:xpath, '//*[@class="HeaderView_email__beGsy"]') }
|
270
260
|
rescue => e
|
271
261
|
puts '-[√] 로그인 실패.......'.red
|
272
262
|
@driver.window_handles.each do |handle|
|
@@ -280,7 +270,7 @@ class Naver
|
|
280
270
|
end
|
281
271
|
return 0
|
282
272
|
@driver.quit
|
283
|
-
end
|
273
|
+
end
|
284
274
|
end
|
285
275
|
|
286
276
|
|
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.63
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- zon
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-07-
|
10
|
+
date: 2025-07-09 00:00:00.000000000 Z
|
11
11
|
dependencies: []
|
12
12
|
description: File to Clipboard gem
|
13
13
|
email: mymin26@naver.com
|