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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/duo_blog_comment.rb +37 -35
  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: a097abc5fdbec47db3d8955918409a32fa918dedbd46c2a8c7f8889c5cacb6be
4
+ data.tar.gz: c634e0e5032ec0ff25f2b912f306e9da2ffdde3b5f613e8df6d21a93c4fb35f5
5
5
  SHA512:
6
- metadata.gz: 1e55d84ea625feb4b6198f4587f91f1ce629879189bc3937bd35d53a3f1e9784a6e06fccf54bfd83b71c858d64107d70c6f7901b263e4e80d04ca8ea98b91ad7
7
- data.tar.gz: a614f0ff5ed18d4b543fb4bf41e9261f6d757e2a84745270c6e7afe47c18c63f37babf660f469f322ea58fc3cfe5b8de6d281d4e911478b4dd7f90ac2a5e36c7
6
+ metadata.gz: 033d32fdb651fc91df6e0a199eb9361081aeace8901eb6871d236266b58fa191ef29fb39c15dba3a9c02e846925feb1279ddc66443500759f03ab5096e35b277
7
+ data.tar.gz: 6c0cc8cc23607faa7b80caf6ecb1be0d2a9b5c0aa1ba16e266e5927bb617b7fd874c098a485a82e6782dd17b0c75cafb3454c0ac4be3da12e331306e113c8b46
@@ -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,61 +188,64 @@ 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
-
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
- 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
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
- end
238
- rescue
239
- end
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, '//*[@type="button" and @class="MyView-module__btn_logout___bsTOJ"]') }
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.62
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-08 00:00:00.000000000 Z
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