zon_blog_comment 0.0.32 → 0.0.35

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/zon_blog_comment.rb +37 -30
  3. metadata +3 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0b26aef8dc809e7f4bcde893160ae1fb293b6ff08cc014dba865567b3504816a
4
- data.tar.gz: '03659c3ac4c279d1f4a25b141dffd91a999ea1f080d79716d26ed0640a6ba8d4'
3
+ metadata.gz: 53551b0a70c3df880a8f7a2992664fe20caf66ba6ad42aa2cc0211fe050c4a85
4
+ data.tar.gz: c19d4ef2b53205ffe89efd6b56c56ffa8422a4d696ae5f51479d13c2ba155672
5
5
  SHA512:
6
- metadata.gz: 3e0f15cf85c3a53b9ec348708b16c0fad99d376cb8a38410086e5a1331de8313510509400a6936f90e143acc3df5404327438c24b4ac43950ec32fb65cbe45fa
7
- data.tar.gz: df080b1de00afa50f75e62a7b6e6af0c1c6ed187f91bc41f659ef13bcb4c27232b1757c8a830293a70d3c16559f56ef9dc49dc7fd15b033c184c765aca4a13ab
6
+ metadata.gz: dee3ec4211e3eafb3594c25fe201a206f814d1cceee507f26ed143cc74d331a7851a07a00670297005bf5aaf42c0e17e4131314a1a0236d27f50e34e181a2454
7
+ data.tar.gz: da10a4122cf73d1daeafb39c56232d8e21c5c7cd33cee96cfc0f204b02d7c35d6883ca3c264c09566b427e56fd044f543dfa23bb4232125508ca13f75aba9737
@@ -14,7 +14,6 @@ require 'clipboard'
14
14
  require 'crack'
15
15
  require 'uri'
16
16
  require 'cgi'
17
- require 'digest'
18
17
  require 'auto_click'
19
18
  require 'rainbow/refinement'
20
19
  include AutoClickMethods
@@ -259,12 +258,7 @@ class Naver
259
258
  end
260
259
  end
261
260
 
262
- def create_id
263
- @seed += 1
264
- hash = Digest::SHA256.hexdigest((Time.now.to_i+@seed).to_s).to_s
265
- answer = "SE-#{hash[0..7]}-#{hash[8..11]}-#{hash[12..15]}-#{hash[16..19]}-#{hash[20..31]}"
266
- return answer
267
- end
261
+
268
262
 
269
263
  def update(content,image,option,counts_number,keyword,blog_url,api_key)
270
264
 
@@ -460,29 +454,42 @@ class Naver
460
454
  @driver.switch_to.frame(@driver.find_element(:xpath, '//*[@id="mainFrame"]')) # 아이프레임 선택
461
455
  sleep(1)
462
456
  begin
463
- @driver.find_element(:xpath, '//*[@id="toplistSpanBlind"]').click
464
- sleep(2)
465
- rescue
466
- begin
467
- @driver.find_element(:xpath, '//*[@class="off itemfont _doNclick _param(false|blog|)"]').click
468
- sleep(2)
469
- wait = Selenium::WebDriver::Wait.new(:timeout => 5)
470
- wait.until { @driver.find_element(:xpath, '//*[@id="toplistSpanBlind"]') }
471
- @driver.find_element(:xpath, '//*[@id="toplistSpanBlind"]').click
472
- sleep(2)
473
- rescue => e
474
- @driver.window_handles.each do |handle|
475
- @driver.switch_to.window(handle)
476
- begin
477
- # 로딩 중이거나, 페이지가 완전히 로딩되지 않더라도 탭을 닫기
478
- puts 'id="toplistSpanBlind" 요소를 찾지 못했습니다.'
479
- @driver.close
480
- rescue Selenium::WebDriver::Error::WebDriverError => e
481
- puts "Failed to close tab: #{e.message}"
482
- end
483
- end
484
- @driver.quit
485
- end
457
+ @driver.find_element(:xpath, '//*[@id="toplistSpanBlind"]').click
458
+ sleep(2)
459
+ rescue
460
+ begin
461
+ @driver.find_element(:xpath, '//*[@class="off itemfont _doNclick _param(false|blog|)"]').click
462
+ sleep(2)
463
+ begin
464
+ wait = Selenium::WebDriver::Wait.new(:timeout => 5)
465
+ wait.until { @driver.find_element(:xpath, '//*[@id="category0"]') }
466
+ element = @driver.find_element(:xpath, '//*[@id="category0"]')
467
+ @driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", element)#크롤 이동
468
+ sleep(2)
469
+ @driver.find_element(:xpath, '//*[@id="category0"]').click
470
+ sleep(2)
471
+ rescue
472
+ end
473
+ wait = Selenium::WebDriver::Wait.new(:timeout => 5)
474
+ wait.until { @driver.find_element(:xpath, '//*[@id="toplistSpanBlind"]') }
475
+ element = @driver.find_element(:xpath, '//*[@id="toplistSpanBlind"]')
476
+ @driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", element)#크롤 이동
477
+ sleep(2)
478
+ @driver.find_element(:xpath, '//*[@id="toplistSpanBlind"]').click
479
+ sleep(1)
480
+ rescue => e
481
+ @driver.window_handles.each do |handle|
482
+ @driver.switch_to.window(handle)
483
+ begin
484
+ # 로딩 중이거나, 페이지가 완전히 로딩되지 않더라도 탭을 닫기
485
+ puts 'id="toplistSpanBlind" 요소를 찾지 못했습니다.'
486
+ @driver.close
487
+ rescue Selenium::WebDriver::Error::WebDriverError => e
488
+ puts "Failed to close tab: #{e.message}"
489
+ end
490
+ end
491
+ @driver.quit
492
+ end
486
493
  end
487
494
 
488
495
 
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zon_blog_comment
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.32
4
+ version: 0.0.35
5
5
  platform: ruby
6
6
  authors:
7
7
  - zon
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2025-03-26 00:00:00.000000000 Z
10
+ date: 2025-04-30 00:00:00.000000000 Z
12
11
  dependencies: []
13
12
  description: File to Clipboard gem
14
13
  email: mymin26@naver.com
@@ -21,7 +20,6 @@ homepage: ''
21
20
  licenses:
22
21
  - zon
23
22
  metadata: {}
24
- post_install_message:
25
23
  rdoc_options: []
26
24
  require_paths:
27
25
  - lib
@@ -36,8 +34,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
36
34
  - !ruby/object:Gem::Version
37
35
  version: '0'
38
36
  requirements: []
39
- rubygems_version: 3.3.7
40
- signing_key:
37
+ rubygems_version: 3.6.7
41
38
  specification_version: 4
42
39
  summary: file to clipboard
43
40
  test_files: []