duo_blog_cafe_comment 0.0.37 → 0.0.50
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.
- checksums.yaml +4 -4
- data/lib/duo_blog_cafe_comment.rb +52 -26
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d0f269852a6be886b3458fe28e3642740ca9ef5b2b228a699292230bd27b2bb2
|
4
|
+
data.tar.gz: 1c24ea03c19951d872f5a045230b0d284ae8b133439f6ad1ba6f54d1d5787a09
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c2c386edd85f83b783afc05ba6282be24be7523f7f6a72bc8371b8895b3ab9d4b49726f6f72e903a97ed938222b56ff05bd36130d6645e40ba37bfe31dfad861
|
7
|
+
data.tar.gz: f4547a40f7f20d35e966030f41292fb912f31fd2e001d74d4569db6abadd17d006b1710b4716cf4a915cdce06ff198db4c3118fea42438e5a22efea0eb6eb30d
|
@@ -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
|
-
|
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,board_url,blog_url,nickname,image,option,counts_number,keyword,api_key)
|
270
264
|
@board_url = board_url
|
@@ -404,6 +398,16 @@ class Naver
|
|
404
398
|
@in_iframe = true
|
405
399
|
end
|
406
400
|
|
401
|
+
begin
|
402
|
+
# 아이프레임 요소가 나타날 때까지 기다립니다.
|
403
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 5)
|
404
|
+
wait.until { @driver.find_element(:xpath, '//*[@class="FormInputCheck"]') }
|
405
|
+
sleep(1)
|
406
|
+
@driver.find_element(:xpath, '//*[@class="FormInputCheck"]').click
|
407
|
+
sleep(2)
|
408
|
+
rescue
|
409
|
+
|
410
|
+
end
|
407
411
|
|
408
412
|
# 한 페이지에 게시글이 15개씩 있다고 가정
|
409
413
|
articles_per_page = 15
|
@@ -430,17 +434,28 @@ class Naver
|
|
430
434
|
# 페이지 넘기기: 다음 페이지로 이동 (class="prev-next" 아래의 페이지 링크 클릭)
|
431
435
|
|
432
436
|
begin
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
437
|
+
next_page_number = (current_page + 1).to_s
|
438
|
+
|
439
|
+
# 페이지 번호 버튼들 찾기
|
440
|
+
pagination_buttons = @driver.find_elements(:css, 'div.Pagination button.btn.number')
|
441
|
+
|
442
|
+
# 텍스트가 다음 페이지 숫자와 같은 버튼 찾기
|
443
|
+
next_button = pagination_buttons.find { |btn| btn.text == next_page_number }
|
444
|
+
|
445
|
+
if next_button
|
446
|
+
next_button.click
|
447
|
+
sleep(2) # 페이지가 로드되도록 대기
|
448
|
+
current_page += 1
|
449
|
+
else
|
450
|
+
puts "다음 페이지 버튼을 찾을 수 없습니다. 현재 페이지: #{current_page}"
|
451
|
+
break
|
452
|
+
end
|
453
|
+
|
454
|
+
rescue => e
|
455
|
+
puts "페이지 넘김 중 오류 발생: #{e.message}"
|
456
|
+
break
|
439
457
|
end
|
440
|
-
|
441
|
-
# 페이지 번호 갱신
|
442
|
-
current_page += 1
|
443
|
-
end
|
458
|
+
end
|
444
459
|
# 수집한 URL 출력
|
445
460
|
|
446
461
|
if @in_iframe
|
@@ -939,16 +954,27 @@ class Naver
|
|
939
954
|
# 페이지 넘기기: 다음 페이지로 이동 (class="prev-next" 아래의 페이지 링크 클릭)
|
940
955
|
|
941
956
|
begin
|
942
|
-
|
943
|
-
|
944
|
-
|
945
|
-
|
946
|
-
|
947
|
-
|
948
|
-
|
957
|
+
next_page_number = (current_page + 1).to_s
|
958
|
+
|
959
|
+
# 페이지 번호 버튼들 찾기
|
960
|
+
pagination_buttons = @driver.find_elements(:css, 'div.Pagination button.btn.number')
|
961
|
+
|
962
|
+
# 텍스트가 다음 페이지 숫자와 같은 버튼 찾기
|
963
|
+
next_button = pagination_buttons.find { |btn| btn.text == next_page_number }
|
949
964
|
|
950
|
-
|
951
|
-
|
965
|
+
if next_button
|
966
|
+
next_button.click
|
967
|
+
sleep(2) # 페이지가 로드되도록 대기
|
968
|
+
current_page += 1
|
969
|
+
else
|
970
|
+
puts "다음 페이지 버튼을 찾을 수 없습니다. 현재 페이지: #{current_page}"
|
971
|
+
break
|
972
|
+
end
|
973
|
+
|
974
|
+
rescue => e
|
975
|
+
puts "페이지 넘김 중 오류 발생: #{e.message}"
|
976
|
+
break
|
977
|
+
end
|
952
978
|
end
|
953
979
|
# 수집한 URL 출력
|
954
980
|
|
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.
|
4
|
+
version: 0.0.50
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- zon
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-04-
|
10
|
+
date: 2025-04-30 00:00:00.000000000 Z
|
11
11
|
dependencies: []
|
12
12
|
description: File to Clipboard gem
|
13
13
|
email: mymin26@naver.com
|