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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/duo_blog_comment.rb +26 -36
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e4a5f566976c42a226d279ca1724acccd53b1d73a74ba8ea1f05ec8de87d38e6
4
- data.tar.gz: d431991d4bf5e95bf3e4e82f8e909875a9ac27ca520b4f412d6100db6032e308
3
+ metadata.gz: cea993be072fe7ee86e4dfa20e17678f2113f18b19eade70f462801150e095af
4
+ data.tar.gz: e34b710e83f34a9b320eb2fc83aaa536ffb12ee39335bf726d8f87f92ae00c95
5
5
  SHA512:
6
- metadata.gz: 1e55d84ea625feb4b6198f4587f91f1ce629879189bc3937bd35d53a3f1e9784a6e06fccf54bfd83b71c858d64107d70c6f7901b263e4e80d04ca8ea98b91ad7
7
- data.tar.gz: a614f0ff5ed18d4b543fb4bf41e9261f6d757e2a84745270c6e7afe47c18c63f37babf660f469f322ea58fc3cfe5b8de6d281d4e911478b4dd7f90ac2a5e36c7
6
+ metadata.gz: d360d1443ef83a3443dbea743b1cde6cbd04fc142193c9b13d3049fc4767442c35b179f3a818749e6e1704280fe4ead7847e66fd2d1d25c4534ca188b6dfd943
7
+ data.tar.gz: 26fda8d6ffcd423807c5cc784fff5d9cf00e763da18b5ab0b93a6f07a30c62409fc9c056d12823a2b49fff103a689319894bca70c63fc72cfd729d0b1efd782f
@@ -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,60 +188,51 @@ 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, '//*[@id="id" and @name="id"]') }
223
- @driver.find_element(:xpath, '//*[@id="id" and @name="id"]').click
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" and @name="pw"]').click
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, '//*[@type="button" and @class="MyView-module__btn_logout___bsTOJ"]') }
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.62
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-08 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