zon_blog_cafe_comment 0.0.57 → 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.
- checksums.yaml +4 -4
- data/lib/zon_blog_cafe_comment.rb +85 -80
- 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: db4a70080f15fbb7bc7f8a014d6e6ee692eedb28aae56ed8b596b50228fb628f
|
4
|
+
data.tar.gz: c9339371cc02c84d48c1b7e39edbbe00c089fa7bb2c1cd04151d960ab78e7255
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3cc3e6bd4c0898d5d6823dabe86b7fcb28bb748a6f08bc84b66e61e4d2ad38b149c963c57da61f16d4615d5473532a252dfa132914b9cea1f59cf12d434a52b7
|
7
|
+
data.tar.gz: 535814d52f71bdddb8341f7b63e4a7d6b5344316a74647524ae9a168301dc2de70f06e6059c968933d206b94ce754656d09b77112eab3591a3f1d41db2491392
|
@@ -499,19 +499,17 @@ class Naver
|
|
499
499
|
@driver.action.send_keys(:page_down).perform #스크롤 내리기
|
500
500
|
sleep(1)
|
501
501
|
|
502
|
-
content_soon
|
503
|
-
|
502
|
+
@content_soon ||= 0 # 초기 한 번만 0으로 세팅
|
503
|
+
|
504
504
|
if @data['내용설정']['내용'].nil? || @data['내용설정']['내용'].empty?
|
505
505
|
content = ''
|
506
|
-
|
506
|
+
else
|
507
507
|
if @data.dig('내용설정', '랜덤사용')&.respond_to?(:checked?) && @data['내용설정']['랜덤사용'].checked?
|
508
|
-
content = @data['내용설정']['내용'].sample[2]
|
508
|
+
content = @data['내용설정']['내용'].sample[2]
|
509
509
|
else
|
510
|
-
|
511
|
-
|
512
|
-
if content_soon >= @data['내용설정']['내용'].length
|
513
|
-
content_soon = 0
|
514
|
-
end
|
510
|
+
content = @data['내용설정']['내용'][@content_soon][2]
|
511
|
+
@content_soon += 1
|
512
|
+
@content_soon = 0 if @content_soon >= @data['내용설정']['내용'].length
|
515
513
|
end
|
516
514
|
end
|
517
515
|
|
@@ -766,19 +764,17 @@ class Naver
|
|
766
764
|
@driver.action.send_keys(:page_down).perform #스크롤 내리기
|
767
765
|
sleep(1)
|
768
766
|
|
769
|
-
content_soon
|
770
|
-
|
767
|
+
@content_soon ||= 0 # 초기 한 번만 0으로 세팅
|
768
|
+
|
771
769
|
if @data['내용설정']['내용'].nil? || @data['내용설정']['내용'].empty?
|
772
770
|
content = ''
|
773
|
-
|
771
|
+
else
|
774
772
|
if @data.dig('내용설정', '랜덤사용')&.respond_to?(:checked?) && @data['내용설정']['랜덤사용'].checked?
|
775
|
-
content = @data['내용설정']['내용'].sample[2]
|
773
|
+
content = @data['내용설정']['내용'].sample[2]
|
776
774
|
else
|
777
|
-
|
778
|
-
|
779
|
-
if content_soon >= @data['내용설정']['내용'].length
|
780
|
-
content_soon = 0
|
781
|
-
end
|
775
|
+
content = @data['내용설정']['내용'][@content_soon][2]
|
776
|
+
@content_soon += 1
|
777
|
+
@content_soon = 0 if @content_soon >= @data['내용설정']['내용'].length
|
782
778
|
end
|
783
779
|
end
|
784
780
|
|
@@ -1115,19 +1111,17 @@ class Naver
|
|
1115
1111
|
@driver.action.send_keys(:page_down).perform #스크롤 내리기
|
1116
1112
|
sleep(1)
|
1117
1113
|
|
1118
|
-
content_soon
|
1119
|
-
|
1114
|
+
@content_soon ||= 0 # 초기 한 번만 0으로 세팅
|
1115
|
+
|
1120
1116
|
if @data['내용설정']['내용'].nil? || @data['내용설정']['내용'].empty?
|
1121
1117
|
content = ''
|
1122
|
-
|
1118
|
+
else
|
1123
1119
|
if @data.dig('내용설정', '랜덤사용')&.respond_to?(:checked?) && @data['내용설정']['랜덤사용'].checked?
|
1124
|
-
content = @data['내용설정']['내용'].sample[2]
|
1120
|
+
content = @data['내용설정']['내용'].sample[2]
|
1125
1121
|
else
|
1126
|
-
|
1127
|
-
|
1128
|
-
if content_soon >= @data['내용설정']['내용'].length
|
1129
|
-
content_soon = 0
|
1130
|
-
end
|
1122
|
+
content = @data['내용설정']['내용'][@content_soon][2]
|
1123
|
+
@content_soon += 1
|
1124
|
+
@content_soon = 0 if @content_soon >= @data['내용설정']['내용'].length
|
1131
1125
|
end
|
1132
1126
|
end
|
1133
1127
|
|
@@ -1550,48 +1544,60 @@ class Naver
|
|
1550
1544
|
@driver.switch_to.frame(@driver.find_element(:xpath, '//*[@id="mainFrame"]')) # 아이프레임 선택
|
1551
1545
|
sleep(1)
|
1552
1546
|
begin
|
1553
|
-
|
1554
|
-
|
1555
|
-
|
1547
|
+
element = @driver.find_element(:xpath, '//*[@id="toplistSpanBlind"]') # 목록 열기 코드
|
1548
|
+
text = element.text.strip
|
1549
|
+
|
1550
|
+
if text == "목록열기"
|
1551
|
+
element.click
|
1552
|
+
sleep(2)
|
1553
|
+
else
|
1554
|
+
|
1555
|
+
end
|
1556
|
+
rescue
|
1556
1557
|
begin
|
1557
|
-
@driver.find_element(:xpath, '//*[@class="off itemfont _doNclick _param(false|blog|)"]').click
|
1558
|
-
sleep(2)
|
1558
|
+
@driver.find_element(:xpath, '//*[@class="off itemfont _doNclick _param(false|blog|)"]').click #블로그 txt 클릭
|
1559
|
+
sleep(2)
|
1560
|
+
rescue
|
1561
|
+
begin
|
1562
|
+
@driver.find_element(:xpath, '//*[@class="on itemfont _doNclick _param(false|blog|)"]').click #블로그 txt 클릭
|
1563
|
+
sleep(2)
|
1564
|
+
rescue
|
1565
|
+
end
|
1566
|
+
end
|
1567
|
+
|
1568
|
+
begin
|
1559
1569
|
begin
|
1560
1570
|
wait = Selenium::WebDriver::Wait.new(:timeout => 5)
|
1561
|
-
wait.until { @driver.find_element(:xpath, '//*[@id="category0"]') }
|
1571
|
+
wait.until { @driver.find_element(:xpath, '//*[@id="category0"]') } # 전체 보기 클릭
|
1562
1572
|
element = @driver.find_element(:xpath, '//*[@id="category0"]')
|
1563
1573
|
@driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", element)#크롤 이동
|
1564
1574
|
sleep(2)
|
1565
|
-
@driver.find_element(:xpath, '//*[@id="category0"]').click
|
1575
|
+
@driver.find_element(:xpath, '//*[@id="category0"]').click # 전체 보기 클릭
|
1566
1576
|
sleep(2)
|
1567
1577
|
rescue
|
1568
1578
|
end
|
1569
1579
|
wait = Selenium::WebDriver::Wait.new(:timeout => 5)
|
1570
|
-
wait.until { @driver.find_element(:xpath, '//*[@id="toplistSpanBlind"]') }
|
1580
|
+
wait.until { @driver.find_element(:xpath, '//*[@id="toplistSpanBlind"]') } # 목록 열기 코드
|
1571
1581
|
element = @driver.find_element(:xpath, '//*[@id="toplistSpanBlind"]')
|
1572
1582
|
@driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", element)#크롤 이동
|
1573
|
-
sleep(2)
|
1574
|
-
@driver.find_element(:xpath, '//*[@id="toplistSpanBlind"]')
|
1575
|
-
|
1576
|
-
|
1577
|
-
|
1578
|
-
|
1579
|
-
|
1580
|
-
|
1581
|
-
puts 'id="toplistSpanBlind" 요소를 찾지 못했습니다.'
|
1582
|
-
@driver.close
|
1583
|
-
rescue Selenium::WebDriver::Error::WebDriverError => e
|
1584
|
-
puts "Failed to close tab: #{e.message}"
|
1585
|
-
end
|
1583
|
+
sleep(2)
|
1584
|
+
element = @driver.find_element(:xpath, '//*[@id="toplistSpanBlind"]')
|
1585
|
+
text = element.text.strip
|
1586
|
+
|
1587
|
+
if text == "목록열기"
|
1588
|
+
element.click
|
1589
|
+
sleep(2)
|
1590
|
+
else
|
1586
1591
|
end
|
1587
|
-
|
1592
|
+
sleep(1)
|
1593
|
+
rescue
|
1588
1594
|
end
|
1589
1595
|
end
|
1590
1596
|
|
1591
1597
|
|
1592
1598
|
begin
|
1593
1599
|
wait = Selenium::WebDriver::Wait.new(:timeout => 3)
|
1594
|
-
wait.until { @driver.find_element(:xpath, '//*[@class="aline"]') }
|
1600
|
+
wait.until { @driver.find_element(:xpath, '//*[@class="aline"]') } # 목록 리스트 (5줄 보기) 클릭
|
1595
1601
|
element = @driver.find_element(:xpath, '//*[@class="aline"]')
|
1596
1602
|
@driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", element)#크롤 이동
|
1597
1603
|
sleep(2)
|
@@ -1600,24 +1606,13 @@ class Naver
|
|
1600
1606
|
rescue
|
1601
1607
|
begin
|
1602
1608
|
wait = Selenium::WebDriver::Wait.new(:timeout => 3)
|
1603
|
-
wait.until { @driver.find_element(:xpath, '//*[@id="listCountToggle"]') }
|
1609
|
+
wait.until { @driver.find_element(:xpath, '//*[@id="listCountToggle"]') } # 목록 리스트 (5줄 보기) 클릭
|
1604
1610
|
element = @driver.find_element(:xpath, '//*[@id="listCountToggle"]')
|
1605
1611
|
@driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", element)#크롤 이동
|
1606
1612
|
sleep(2)
|
1607
1613
|
element.send_keys(:return)
|
1608
1614
|
sleep(1)
|
1609
|
-
rescue
|
1610
|
-
@driver.window_handles.each do |handle|
|
1611
|
-
@driver.switch_to.window(handle)
|
1612
|
-
begin
|
1613
|
-
# 로딩 중이거나, 페이지가 완전히 로딩되지 않더라도 탭을 닫기
|
1614
|
-
puts 'class="aline" 요소를 찾지 못했습니다.'
|
1615
|
-
@driver.close
|
1616
|
-
rescue Selenium::WebDriver::Error::WebDriverError => e
|
1617
|
-
puts "Failed to close tab: #{e.message}"
|
1618
|
-
end
|
1619
|
-
end
|
1620
|
-
@driver.quit
|
1615
|
+
rescue
|
1621
1616
|
end
|
1622
1617
|
end
|
1623
1618
|
|
@@ -2136,19 +2131,17 @@ class Naver
|
|
2136
2131
|
else
|
2137
2132
|
end
|
2138
2133
|
|
2139
|
-
content_soon
|
2140
|
-
|
2134
|
+
@content_soon ||= 0 # 초기 한 번만 0으로 세팅
|
2135
|
+
|
2141
2136
|
if @data['내용설정']['내용'].nil? || @data['내용설정']['내용'].empty?
|
2142
2137
|
content = ''
|
2143
|
-
|
2138
|
+
else
|
2144
2139
|
if @data.dig('내용설정', '랜덤사용')&.respond_to?(:checked?) && @data['내용설정']['랜덤사용'].checked?
|
2145
|
-
content = @data['내용설정']['내용'].sample[2]
|
2140
|
+
content = @data['내용설정']['내용'].sample[2]
|
2146
2141
|
else
|
2147
|
-
|
2148
|
-
|
2149
|
-
if content_soon >= @data['내용설정']['내용'].length
|
2150
|
-
content_soon = 0
|
2151
|
-
end
|
2142
|
+
content = @data['내용설정']['내용'][@content_soon][2]
|
2143
|
+
@content_soon += 1
|
2144
|
+
@content_soon = 0 if @content_soon >= @data['내용설정']['내용'].length
|
2152
2145
|
end
|
2153
2146
|
end
|
2154
2147
|
|
@@ -2167,16 +2160,28 @@ class Naver
|
|
2167
2160
|
end
|
2168
2161
|
|
2169
2162
|
begin #댓글 작업 >> 시작
|
2163
|
+
# 댓글 쓰기 버튼 클릭
|
2170
2164
|
# 댓글 쓰기 버튼 클릭
|
2171
2165
|
begin
|
2172
|
-
|
2173
|
-
|
2174
|
-
|
2175
|
-
|
2176
|
-
|
2177
|
-
|
2178
|
-
|
2179
|
-
|
2166
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 3)
|
2167
|
+
wait.until { @driver.find_element(:xpath, '//*[@class="area_comment pcol2"]') }
|
2168
|
+
element = @driver.find_element(:xpath, '//*[@class="area_comment pcol2"]')
|
2169
|
+
@driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", element) # 크롤 이동
|
2170
|
+
sleep(1)
|
2171
|
+
@driver.find_element(:xpath, '//*[@class="area_comment pcol2"]').click
|
2172
|
+
sleep(1)
|
2173
|
+
rescue
|
2174
|
+
begin
|
2175
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 3)
|
2176
|
+
wait.until { @driver.find_element(xpath: "//span[@class='btn_arr']//span[@class='blind']") }
|
2177
|
+
element = @driver.find_element(xpath: "//span[@class='btn_arr']//span[@class='blind']")
|
2178
|
+
@driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", element) # 크롤 이동
|
2179
|
+
sleep(1)
|
2180
|
+
@driver.find_element(xpath: "//span[@class='btn_arr']//span[@class='blind']").click
|
2181
|
+
sleep(1)
|
2182
|
+
rescue => e
|
2183
|
+
puts "댓글 작성 필드가 존재 하지않습니다."
|
2184
|
+
end
|
2180
2185
|
end
|
2181
2186
|
|
2182
2187
|
if option['댓글패스'] == 'true'
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zon_blog_cafe_comment
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
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-06-
|
10
|
+
date: 2025-06-27 00:00:00.000000000 Z
|
11
11
|
dependencies: []
|
12
12
|
description: File to Clipboard gem
|
13
13
|
email: mymin26@naver.com
|