duo_blog_cafe_comment 0.0.60 → 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/duo_blog_cafe_comment.rb +75 -67
- 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: c37bb39d390e82814ab84630ae456762244eda8f14d655231c95eea8ec44f030
|
4
|
+
data.tar.gz: 0bfd83921afdf77e883f3809ac3b6140e616e4381b309f6d2b085f799c0b9c90
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f198eb965eec9029ec8237d6478767a50ffea221aa3ec8761d0eaf8931643480ac74e572dfce8a60a5f2b1215f30d22f784241e5acc366ac472572f2324b7940
|
7
|
+
data.tar.gz: 871de6e5c0808380c9b0e692f0170e17214f2c519dcc876b008e7d417d70f5da11ce130ce1aaff0fa7a4063bcd94723caf558ab488c6f3ef57e38434558bf76b
|
@@ -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,7 +1544,7 @@ class Naver
|
|
1550
1544
|
@driver.switch_to.frame(@driver.find_element(:xpath, '//*[@id="mainFrame"]')) # 아이프레임 선택
|
1551
1545
|
sleep(1)
|
1552
1546
|
begin
|
1553
|
-
element = @driver.find_element(:xpath, '//*[@id="toplistSpanBlind"]')
|
1547
|
+
element = @driver.find_element(:xpath, '//*[@id="toplistSpanBlind"]') # 목록 열기 코드
|
1554
1548
|
text = element.text.strip
|
1555
1549
|
|
1556
1550
|
if text == "목록열기"
|
@@ -1559,46 +1553,51 @@ class Naver
|
|
1559
1553
|
else
|
1560
1554
|
|
1561
1555
|
end
|
1562
|
-
rescue
|
1556
|
+
rescue
|
1563
1557
|
begin
|
1564
|
-
@driver.find_element(:xpath, '//*[@class="off itemfont _doNclick _param(false|blog|)"]').click
|
1565
|
-
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
|
1566
1569
|
begin
|
1567
1570
|
wait = Selenium::WebDriver::Wait.new(:timeout => 5)
|
1568
|
-
wait.until { @driver.find_element(:xpath, '//*[@id="category0"]') }
|
1571
|
+
wait.until { @driver.find_element(:xpath, '//*[@id="category0"]') } # 전체 보기 클릭
|
1569
1572
|
element = @driver.find_element(:xpath, '//*[@id="category0"]')
|
1570
1573
|
@driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", element)#크롤 이동
|
1571
1574
|
sleep(2)
|
1572
|
-
@driver.find_element(:xpath, '//*[@id="category0"]').click
|
1575
|
+
@driver.find_element(:xpath, '//*[@id="category0"]').click # 전체 보기 클릭
|
1573
1576
|
sleep(2)
|
1574
1577
|
rescue
|
1575
1578
|
end
|
1576
1579
|
wait = Selenium::WebDriver::Wait.new(:timeout => 5)
|
1577
|
-
wait.until { @driver.find_element(:xpath, '//*[@id="toplistSpanBlind"]') }
|
1580
|
+
wait.until { @driver.find_element(:xpath, '//*[@id="toplistSpanBlind"]') } # 목록 열기 코드
|
1578
1581
|
element = @driver.find_element(:xpath, '//*[@id="toplistSpanBlind"]')
|
1579
1582
|
@driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", element)#크롤 이동
|
1580
|
-
sleep(2)
|
1581
|
-
@driver.find_element(:xpath, '//*[@id="toplistSpanBlind"]')
|
1582
|
-
|
1583
|
-
|
1584
|
-
|
1585
|
-
|
1586
|
-
|
1587
|
-
|
1588
|
-
puts 'id="toplistSpanBlind" 요소를 찾지 못했습니다.'
|
1589
|
-
@driver.close
|
1590
|
-
rescue Selenium::WebDriver::Error::WebDriverError => e
|
1591
|
-
puts "Failed to close tab: #{e.message}"
|
1592
|
-
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
|
1593
1591
|
end
|
1594
|
-
|
1592
|
+
sleep(1)
|
1593
|
+
rescue
|
1595
1594
|
end
|
1596
1595
|
end
|
1597
1596
|
|
1598
1597
|
|
1599
1598
|
begin
|
1600
1599
|
wait = Selenium::WebDriver::Wait.new(:timeout => 3)
|
1601
|
-
wait.until { @driver.find_element(:xpath, '//*[@class="aline"]') }
|
1600
|
+
wait.until { @driver.find_element(:xpath, '//*[@class="aline"]') } # 목록 리스트 (5줄 보기) 클릭
|
1602
1601
|
element = @driver.find_element(:xpath, '//*[@class="aline"]')
|
1603
1602
|
@driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", element)#크롤 이동
|
1604
1603
|
sleep(2)
|
@@ -1607,7 +1606,7 @@ class Naver
|
|
1607
1606
|
rescue
|
1608
1607
|
begin
|
1609
1608
|
wait = Selenium::WebDriver::Wait.new(:timeout => 3)
|
1610
|
-
wait.until { @driver.find_element(:xpath, '//*[@id="listCountToggle"]') }
|
1609
|
+
wait.until { @driver.find_element(:xpath, '//*[@id="listCountToggle"]') } # 목록 리스트 (5줄 보기) 클릭
|
1611
1610
|
element = @driver.find_element(:xpath, '//*[@id="listCountToggle"]')
|
1612
1611
|
@driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", element)#크롤 이동
|
1613
1612
|
sleep(2)
|
@@ -2132,19 +2131,17 @@ class Naver
|
|
2132
2131
|
else
|
2133
2132
|
end
|
2134
2133
|
|
2135
|
-
content_soon
|
2136
|
-
|
2134
|
+
@content_soon ||= 0 # 초기 한 번만 0으로 세팅
|
2135
|
+
|
2137
2136
|
if @data['내용설정']['내용'].nil? || @data['내용설정']['내용'].empty?
|
2138
2137
|
content = ''
|
2139
|
-
|
2138
|
+
else
|
2140
2139
|
if @data.dig('내용설정', '랜덤사용')&.respond_to?(:checked?) && @data['내용설정']['랜덤사용'].checked?
|
2141
|
-
content = @data['내용설정']['내용'].sample[2]
|
2140
|
+
content = @data['내용설정']['내용'].sample[2]
|
2142
2141
|
else
|
2143
|
-
|
2144
|
-
|
2145
|
-
if content_soon >= @data['내용설정']['내용'].length
|
2146
|
-
content_soon = 0
|
2147
|
-
end
|
2142
|
+
content = @data['내용설정']['내용'][@content_soon][2]
|
2143
|
+
@content_soon += 1
|
2144
|
+
@content_soon = 0 if @content_soon >= @data['내용설정']['내용'].length
|
2148
2145
|
end
|
2149
2146
|
end
|
2150
2147
|
|
@@ -2165,14 +2162,25 @@ class Naver
|
|
2165
2162
|
begin #댓글 작업 >> 시작
|
2166
2163
|
# 댓글 쓰기 버튼 클릭
|
2167
2164
|
begin
|
2168
|
-
|
2169
|
-
|
2170
|
-
|
2171
|
-
|
2172
|
-
|
2173
|
-
|
2174
|
-
|
2175
|
-
|
2165
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 3)
|
2166
|
+
wait.until { @driver.find_element(:xpath, '//*[@class="area_comment pcol2"]') }
|
2167
|
+
element = @driver.find_element(:xpath, '//*[@class="area_comment pcol2"]')
|
2168
|
+
@driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", element) # 크롤 이동
|
2169
|
+
sleep(1)
|
2170
|
+
@driver.find_element(:xpath, '//*[@class="area_comment pcol2"]').click
|
2171
|
+
sleep(1)
|
2172
|
+
rescue
|
2173
|
+
begin
|
2174
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 3)
|
2175
|
+
wait.until { @driver.find_element(xpath: "//span[@class='btn_arr']//span[@class='blind']") }
|
2176
|
+
element = @driver.find_element(xpath: "//span[@class='btn_arr']//span[@class='blind']")
|
2177
|
+
@driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", element) # 크롤 이동
|
2178
|
+
sleep(1)
|
2179
|
+
@driver.find_element(xpath: "//span[@class='btn_arr']//span[@class='blind']").click
|
2180
|
+
sleep(1)
|
2181
|
+
rescue => e
|
2182
|
+
puts "댓글 작성 필드가 존재 하지않습니다."
|
2183
|
+
end
|
2176
2184
|
end
|
2177
2185
|
|
2178
2186
|
if option['댓글패스'] == 'true'
|
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.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
|