duo_blog_comment 0.0.62 → 0.0.65
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 +37 -35
- 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: a097abc5fdbec47db3d8955918409a32fa918dedbd46c2a8c7f8889c5cacb6be
|
4
|
+
data.tar.gz: c634e0e5032ec0ff25f2b912f306e9da2ffdde3b5f613e8df6d21a93c4fb35f5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 033d32fdb651fc91df6e0a199eb9361081aeace8901eb6871d236266b58fa191ef29fb39c15dba3a9c02e846925feb1279ddc66443500759f03ab5096e35b277
|
7
|
+
data.tar.gz: 6c0cc8cc23607faa7b80caf6ecb1be0d2a9b5c0aa1ba16e266e5927bb617b7fd874c098a485a82e6782dd17b0c75cafb3454c0ac4be3da12e331306e113c8b46
|
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,61 +188,64 @@ 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
|
-
|
235
|
+
@driver.find_element(:xpath, '//*[@type="submit" and @class="btn_check next_step" and @id="submit_btn"]').click
|
236
|
+
sleep(2.5)
|
232
237
|
begin
|
233
|
-
|
234
|
-
|
235
|
-
@driver.find_element(xpath
|
238
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 3)
|
239
|
+
#요소가 나타날 때까지 3초 동안 기다립니다.
|
240
|
+
wait.until { @driver.find_element(:xpath, '//button[@ype="button" and @id="new.save" and @class="btn_check nlog-click"]') } #기기 확인 버튼 확인
|
241
|
+
#wait.until { @driver.find_element(:xpath, '//button[@ype="button" and @id="new.dontsave" and @class="btn_white nlog-click"]') } #기기 취소 버튼 확인
|
236
242
|
sleep(1.5)
|
237
|
-
|
238
|
-
|
239
|
-
|
243
|
+
@driver.find_element(:xpath, '//button[@ype="button" and @id="new.save" and @class="btn_check nlog-click"]').click
|
244
|
+
#@driver.find_element(:xpath, '//button[@ype="button" and @id="new.dontsave" and @class="btn_white nlog-click"]') #기기 취소 버튼 클릭
|
245
|
+
rescue
|
246
|
+
end
|
247
|
+
|
240
248
|
|
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
|
245
|
-
sleep(2.5)
|
246
249
|
rescue => e
|
247
250
|
puts '-[√] 로딩 지연 접속 실패.......'.red
|
248
251
|
@driver.window_handles.each do |handle|
|
@@ -256,7 +259,7 @@ class Naver
|
|
256
259
|
end
|
257
260
|
return 0
|
258
261
|
@driver.quit
|
259
|
-
end
|
262
|
+
end
|
260
263
|
|
261
264
|
else
|
262
265
|
# @driver.switch_to.default_content
|
@@ -265,8 +268,7 @@ class Naver
|
|
265
268
|
begin
|
266
269
|
wait = Selenium::WebDriver::Wait.new(:timeout => 5)
|
267
270
|
#요소가 나타날 때까지 3초 동안 기다립니다.
|
268
|
-
wait.until { @driver.find_element(:xpath, '//*[@
|
269
|
-
|
271
|
+
wait.until { @driver.find_element(:xpath, '//*[@class="HeaderView_email__beGsy"]') }
|
270
272
|
rescue => e
|
271
273
|
puts '-[√] 로그인 실패.......'.red
|
272
274
|
@driver.window_handles.each do |handle|
|
@@ -280,7 +282,7 @@ class Naver
|
|
280
282
|
end
|
281
283
|
return 0
|
282
284
|
@driver.quit
|
283
|
-
end
|
285
|
+
end
|
284
286
|
end
|
285
287
|
|
286
288
|
|
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.65
|
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-16 00:00:00.000000000 Z
|
11
11
|
dependencies: []
|
12
12
|
description: File to Clipboard gem
|
13
13
|
email: mymin26@naver.com
|