duo_blog_cafe_comment 0.0.69 → 0.0.71

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_cafe_comment.rb +122 -20
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9ce9bdd305220ab0b314a8c37de021fe9d56a17cd3bf799ad1f342c26557e24a
4
- data.tar.gz: fd229cdc4da411f1bacb273cbcd875d1f4db64287d758e30696c6fcde44df681
3
+ metadata.gz: a34a0e7c33c86570ca531887203c344db586a0f448ac989423b61b0eae42070f
4
+ data.tar.gz: c457dab0cbdc1ac83be43ff8c588f92fb25ed12a894dc9ec2b54df6725d01252
5
5
  SHA512:
6
- metadata.gz: 8740ac687a87154badcddfdf421432fc68e34ef6d2901f357ce5d26546a7e2c93739d66abe526e4d69b9770689240625939ceac26644e46f805c1232eb5bfc69
7
- data.tar.gz: 93cad3d97e729ee29084674f0f43233ec36909d85a41497d39814260bdea4d4b9d633ebe7fe4f8b80dbde8880e4338814482eb47e4391c981b82989149ebc8b3
6
+ metadata.gz: 2daffc91149b2cfa640816fa6afacbbe9a32744ceaa5ea14e8cadc0b62458efdf8af211c661c9cf4e6df66e84c2e5e3b8c5424aa9728529e57faa3be11a0c0db
7
+ data.tar.gz: e379c0e36f4578b3ed51bea54849cb376bae5e11d102c2a9da8835b85d84d001443ba167f4c510af032c57d35c6761f8d67edb410a861218e23d0cc228205390
@@ -219,19 +219,29 @@ class Naver
219
219
  begin
220
220
  wait = Selenium::WebDriver::Wait.new(:timeout => 7)
221
221
  #요소가 나타날 때까지 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
225
- sleep(1.5)
226
- @driver.find_element(:xpath, '//*[@id="id"]').click
222
+ wait.until { @driver.find_element(:xpath, '//*[@id="id" and @name="id"]') }
223
+ @driver.find_element(:xpath, '//*[@id="id" and @name="id"]').click
227
224
  Clipboard.copy(user_id)
228
225
  @driver.action.key_down(:control).send_keys('v').key_up(:control).perform
229
226
  sleep(1.5)
230
- @driver.find_element(:xpath, '//*[@id="pw"]').click
227
+ @driver.find_element(:xpath, '//*[@id="pw" and @name="pw"]').click
231
228
  Clipboard.copy(user_pw)
232
229
  @driver.action.key_down(:control).send_keys('v').key_up(:control).perform
233
230
  sleep(1.5)
234
- @driver.find_element(:xpath, '//*[@id="log.login"]').click
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
245
  sleep(2.5)
236
246
  rescue => e
237
247
  puts '-[√] 로딩 지연 접속 실패.......'.red
@@ -253,9 +263,9 @@ class Naver
253
263
  end
254
264
 
255
265
  begin
256
- wait = Selenium::WebDriver::Wait.new(:timeout => 3)
266
+ wait = Selenium::WebDriver::Wait.new(:timeout => 5)
257
267
  #요소가 나타날 때까지 3초 동안 기다립니다.
258
- wait.until { @driver.find_element(:xpath, '//*[@class="MyView-module__btn_logout___bsTOJ"]') }
268
+ wait.until { @driver.find_element(:xpath, '//*[@type="button" and @class="MyView-module__btn_logout___bsTOJ"]') }
259
269
 
260
270
  rescue => e
261
271
  puts '-[√] 로그인 실패.......'.red
@@ -2755,7 +2765,7 @@ class Naver
2755
2765
  puts "대댓글 등록 중 오류 발생: #{e.message}"
2756
2766
  end
2757
2767
  end
2758
-
2768
+
2759
2769
  puts "닉네임 '#{target}'을 포함한 댓글을 찾지 못했습니다." unless matched
2760
2770
 
2761
2771
  end
@@ -2912,8 +2922,9 @@ class Naver
2912
2922
 
2913
2923
  wait.until { @driver.find_element(:xpath, '//*[@class="button btn_register is_active"]') }
2914
2924
  @driver.find_element(:xpath, '//*[@class="button btn_register is_active"]').click
2915
- puts "#{board_url} [댓글 작성 완료 !!]".cyan
2916
2925
  sleep(2)
2926
+ posting_url = @driver.current_url
2927
+ puts "#{posting_url} [댓글 진행 완료 !!]".cyan
2917
2928
  end
2918
2929
 
2919
2930
 
@@ -4102,6 +4113,51 @@ class Naver
4102
4113
  next
4103
4114
  end
4104
4115
  end
4116
+
4117
+ posting_url = @driver.current_url
4118
+ puts "#{posting_url} [대 댓글 진행 완료 !!]".cyan
4119
+ sleep(2)
4120
+ begin
4121
+ @driver.switch_to.alert
4122
+ sleep(1)
4123
+ error_text = @driver.switch_to.alert.text
4124
+ sleep(1)
4125
+ @driver.switch_to.alert.accept
4126
+ puts (error_text).red
4127
+ posting_url = @driver.current_url
4128
+
4129
+ File.open('./log/posting_log.txt', 'a') do |ff|
4130
+ ff.write('[')
4131
+ ff.write(DateTime.now.strftime("%Y년%m월%d일%H시%M분"))
4132
+ ff.write(']')
4133
+ ff.write(' ')
4134
+ ff.write('【등록실패:')
4135
+ ff.write(error_text)
4136
+ ff.write('】')
4137
+ ff.write(' ')
4138
+ ff.write(posting_url)
4139
+ ff.close()
4140
+ puts '-[√] 로그 파일 생성 완료.......'.yellow
4141
+ end
4142
+
4143
+ rescue
4144
+ #@driver.execute_script("document.body.style.zoom = '1.00'")
4145
+ sleep(1)
4146
+ posting_url = @driver.current_url
4147
+
4148
+ File.open('./log/posting_log.txt', 'a') do |ff|
4149
+ ff.write('[')
4150
+ ff.write(DateTime.now.strftime("%Y년%m월%d일%H시%M분"))
4151
+ ff.write(']')
4152
+ ff.write(' ')
4153
+ ff.write('【등록성공확인】')
4154
+ ff.write(' ')
4155
+ ff.write(posting_url)
4156
+ ff.write("\n")
4157
+ ff.close()
4158
+ puts '-[√] 로그 파일 생성 완료.......'.yellow
4159
+ end
4160
+ end
4105
4161
 
4106
4162
  rescue => e
4107
4163
  puts "전체 처리 중 예외 발생: #{e.message}"
@@ -4464,7 +4520,52 @@ class Naver
4464
4520
  end
4465
4521
  end
4466
4522
  end
4467
-
4523
+ posting_url = @driver.current_url
4524
+ puts "#{posting_url} [대 댓글 진행 완료 !!]".cyan
4525
+ sleep(2)
4526
+ begin
4527
+ @driver.switch_to.alert
4528
+ sleep(1)
4529
+ error_text = @driver.switch_to.alert.text
4530
+ sleep(1)
4531
+ @driver.switch_to.alert.accept
4532
+ puts (error_text).red
4533
+ posting_url = @driver.current_url
4534
+
4535
+ File.open('./log/posting_log.txt', 'a') do |ff|
4536
+ ff.write('[')
4537
+ ff.write(DateTime.now.strftime("%Y년%m월%d일%H시%M분"))
4538
+ ff.write(']')
4539
+ ff.write(' ')
4540
+ ff.write('【등록실패:')
4541
+ ff.write(error_text)
4542
+ ff.write('】')
4543
+ ff.write(' ')
4544
+ ff.write(posting_url)
4545
+ ff.close()
4546
+ puts '-[√] 로그 파일 생성 완료.......'.yellow
4547
+ end
4548
+
4549
+ rescue
4550
+ #@driver.execute_script("document.body.style.zoom = '1.00'")
4551
+ sleep(1)
4552
+ posting_url = @driver.current_url
4553
+
4554
+ File.open('./log/posting_log.txt', 'a') do |ff|
4555
+ ff.write('[')
4556
+ ff.write(DateTime.now.strftime("%Y년%m월%d일%H시%M분"))
4557
+ ff.write(']')
4558
+ ff.write(' ')
4559
+ ff.write('【등록성공확인】')
4560
+ ff.write(' ')
4561
+ ff.write(posting_url)
4562
+ ff.write("\n")
4563
+ ff.close()
4564
+ puts '-[√] 로그 파일 생성 완료.......'.yellow
4565
+ end
4566
+ end
4567
+
4568
+
4468
4569
  rescue => e
4469
4570
  puts "전체 처리 중 예외 발생: #{e.message}"
4470
4571
  end
@@ -4753,17 +4854,18 @@ class Naver
4753
4854
  sleep(2)
4754
4855
  @driver.find_element(:xpath, '//*[@class="u_cbox_txt_upload"]').click #등록버튼
4755
4856
  rescue
4756
- end
4757
- begin
4758
- element = @driver.find_element(:xpath, '//*[@data-log="RPC.write"]')
4759
- @driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", element) # 크롤 이동
4760
- sleep(2)
4761
- @driver.find_element(:xpath, '//*[@data-log="RPC.write"]').click #등록버튼
4762
- rescue
4857
+ begin
4858
+ element = @driver.find_element(:xpath, '//*[@data-log="RPC.write"]')
4859
+ @driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", element) # 크롤 이동
4860
+ sleep(2)
4861
+ @driver.find_element(:xpath, '//*[@data-log="RPC.write"]').click #등록버튼
4862
+ rescue
4863
+ end
4763
4864
  end
4764
4865
  end
4765
4866
  end
4766
- puts "#{board_url} [댓글 작성 완료 !!]".cyan
4867
+ posting_url = @driver.current_url
4868
+ puts "#{posting_url} [댓글 작성 완료 !!]".cyan
4767
4869
 
4768
4870
  sleep(2)
4769
4871
  begin
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: duo_blog_cafe_comment
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.69
4
+ version: 0.0.71
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-08 00:00:00.000000000 Z
11
11
  dependencies: []
12
12
  description: File to Clipboard gem
13
13
  email: mymin26@naver.com