duo_cafe_comment 0.0.51 → 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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/duo_cafe_comment.rb +23 -23
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8fea0b261309b5b8ee9575f91d272d9132f708c41a292066fbc300f08a0cfb4d
4
- data.tar.gz: b95a23c51530b453a0b354671f5f369320a00d19c09132669d27c7e7c73f3d99
3
+ metadata.gz: 208cdd771e92323431be9fba12a0caabe3f542fa76844df24a6abc9fc6d30368
4
+ data.tar.gz: 02d9d4ab977c067d00df55e2a219c5f59ee556aa7b0d9bcad165ceb12ed4c82f
5
5
  SHA512:
6
- metadata.gz: d4abb67e7d1b6fd1ab51d64cc367734c77b19d0f2f6d15f929ba56d14e72c77e70b95523512bd1d475fe66274df359701f7b74c68a973a89809fb3bc77dd639b
7
- data.tar.gz: 18a674fcc5440144ed7180ad1e025d6269b4fbd6db8b391b62b514e72eb03d805bc4ffd7425638b0300e2ab27fcf94d6756174fb89c49d11daa1c56528e6924e
6
+ metadata.gz: dc87be4d8a707af8c1132d22d4d37d89cdc4d98490684e3faa2f1ee5e5c66d89f892a61080e4d01d79c134daaaa919371a86d9674b7b0cc14634d7641867f9b3
7
+ data.tar.gz: 0d26d7e1326fd6284ca65af293b1fdee508053be16f9acf7c504fbb8c0257219c4455a3d8f2940df9b9448399f12bf30569a37bb1de33209210a69ea2e84ef8c
@@ -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/ --remote-debugging-port=9222 --user-data-dir=C:/naver_cookie/#{user_id} --no-first-run --no-default-browser-check --disable-sync})
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/ --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})
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,41 +188,42 @@ class Naver
188
188
 
189
189
 
190
190
  chrome_start(proxy, user_id)
191
- @driver.get('https://www.naver.com')
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 => 7)
196
+ wait = Selenium::WebDriver::Wait.new(:timeout => 5)
199
197
  #요소가 나타날 때까지 3초 동안 기다립니다.
200
- wait.until { @driver.find_element(:xpath, '//*[@class="MyView-module__btn_logout___bsTOJ"]') }
198
+ wait.until { @driver.find_element(:xpath, '//*[@class="HeaderView_email__beGsy"]') }
201
199
  sleep(1.5)
202
200
  check_cookie_login = 1
203
- puts'[Step.02] 계정 세션 확인!! 로그인 skip.......'.yellow
201
+ puts' 계정 세션 확인!! 로그인 skip.......'.yellow
204
202
  sleep(2.5)
205
203
  rescue
206
- wait = Selenium::WebDriver::Wait.new(:timeout => 7)
207
- #요소가 나타날 때까지 3초 동안 기다립니다.
208
- wait.until { @driver.find_element(:xpath, '//*[@class="MyView-module__link_login___HpHMW"]') }
209
- sleep(1.5)
210
- @driver.find_element(:xpath, '//*[@class="MyView-module__link_login___HpHMW"]').click
211
- check_cookie_login = 0
212
- sleep(1)
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'[Step.02] 계정 세션이 없거나 기간 만료로 인해 로그인 시도.......'.yellow
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, '//*[@for="switch"]') }
223
- sleep(1.5)
224
- @driver.find_element(:xpath, '//*[@id="login_keep_wrap"]/div[1]/label').click
224
+ wait.until { @driver.find_element(:xpath, '//*[@id="id"]') }
225
225
  sleep(1.5)
226
+
226
227
  @driver.find_element(:xpath, '//*[@id="id"]').click
227
228
  Clipboard.copy(user_id)
228
229
  @driver.action.key_down(:control).send_keys('v').key_up(:control).perform
@@ -231,7 +232,7 @@ class Naver
231
232
  Clipboard.copy(user_pw)
232
233
  @driver.action.key_down(:control).send_keys('v').key_up(:control).perform
233
234
  sleep(1.5)
234
- @driver.find_element(:xpath, '//*[@id="log.login"]').click
235
+ @driver.find_element(:xpath, '//*[@type="submit" and @class="btn_check next_step" and @id="submit_btn"]').click
235
236
  sleep(2.5)
236
237
  rescue => e
237
238
  puts '-[√] 로딩 지연 접속 실패.......'.red
@@ -253,10 +254,9 @@ class Naver
253
254
  end
254
255
 
255
256
  begin
256
- wait = Selenium::WebDriver::Wait.new(:timeout => 3)
257
+ wait = Selenium::WebDriver::Wait.new(:timeout => 5)
257
258
  #요소가 나타날 때까지 3초 동안 기다립니다.
258
- wait.until { @driver.find_element(:xpath, '//*[@class="MyView-module__btn_logout___bsTOJ"]') }
259
-
259
+ wait.until { @driver.find_element(:xpath, '//*[@class="HeaderView_email__beGsy"]') }
260
260
  rescue => e
261
261
  puts '-[√] 로그인 실패.......'.red
262
262
  @driver.window_handles.each do |handle|
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: duo_cafe_comment
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.51
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-07-07 00:00:00.000000000 Z
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