nblog_duo 111.120.010 → 111.120.013
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/nblog_duo.rb +73 -5
- 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: c0990506a17e5cd4afc02b3c5c4c1939582187e9ce901b1c9c7bf543cc64680a
|
4
|
+
data.tar.gz: d4c00f45f9f213fe75f145e8d30c9abfdef83076b8bd42c60fb1e2eec4b494b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f4211803c37229f01788aaff8d8fef4eef9004fda0cff529d8fa8844c5870ea59c99c0ac672096f7e5d62e0de99ed1557bbfa314c50f7a4a1b9c4a9117186281
|
7
|
+
data.tar.gz: 5fb1a205d9e706992fe87cc41eb2e64d472cd547e5c2801e741cf1b84c18d51b4905a21c65b08bf4f633df6c4498679b646b0f0d60c6419c0754f4df27a8e0bd
|
data/lib/nblog_duo.rb
CHANGED
@@ -515,6 +515,18 @@ class Naver
|
|
515
515
|
sleep(1.5)
|
516
516
|
@driver.find_element(:xpath, '//*[@type="submit" and @class="btn_check next_step" and @id="submit_btn"]').click
|
517
517
|
sleep(2.5)
|
518
|
+
begin
|
519
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 3)
|
520
|
+
#요소가 나타날 때까지 3초 동안 기다립니다.
|
521
|
+
wait.until { @driver.find_element(:xpath, '//button[@ype="button" and @id="new.save" and @class="btn_check nlog-click"]') } #기기 확인 버튼 확인
|
522
|
+
#wait.until { @driver.find_element(:xpath, '//button[@ype="button" and @id="new.dontsave" and @class="btn_white nlog-click"]') } #기기 취소 버튼 확인
|
523
|
+
sleep(1.5)
|
524
|
+
@driver.find_element(:xpath, '//button[@ype="button" and @id="new.save" and @class="btn_check nlog-click"]').click
|
525
|
+
#@driver.find_element(:xpath, '//button[@ype="button" and @id="new.dontsave" and @class="btn_white nlog-click"]') #기기 취소 버튼 클릭
|
526
|
+
rescue
|
527
|
+
end
|
528
|
+
|
529
|
+
|
518
530
|
rescue => e
|
519
531
|
puts '-[√] 로딩 지연 접속 실패.......'.red
|
520
532
|
@driver.window_handles.each do |handle|
|
@@ -764,7 +776,7 @@ class Naver
|
|
764
776
|
end
|
765
777
|
end
|
766
778
|
|
767
|
-
def update(title, content, option, soosick_1, soosick_2, dd_time)
|
779
|
+
def update(title, content, option, soosick_1, soosick_2, dd_time, image_nom)
|
768
780
|
#@driver.get(@url+'?Redirect=Write')
|
769
781
|
#sleep(15)
|
770
782
|
#sleep(2)
|
@@ -1801,6 +1813,43 @@ class Naver
|
|
1801
1813
|
else
|
1802
1814
|
|
1803
1815
|
end
|
1816
|
+
|
1817
|
+
if option['대표사진설정'] == 'true'
|
1818
|
+
puts "대표 사진 설정중"
|
1819
|
+
puts "대표 사진 넘버: #{image_nom}"
|
1820
|
+
|
1821
|
+
image_nom_int = image_nom.to_i # <- 여기 추가!
|
1822
|
+
|
1823
|
+
if image_nom_int < 1
|
1824
|
+
puts "⚠️ 대표사진 넘버가 잘못되었습니다. 최소값은 1입니다."
|
1825
|
+
else
|
1826
|
+
target_index = image_nom_int - 1
|
1827
|
+
begin
|
1828
|
+
wait = Selenium::WebDriver::Wait.new(timeout: 10)
|
1829
|
+
element = @driver.find_elements(:xpath, "//strong[@class='se-panel-title' and text()='라이브러리']")
|
1830
|
+
unless element.any? && element.first.displayed?
|
1831
|
+
span = wait.until {
|
1832
|
+
el = @driver.find_element(:xpath, "//span[@class='se-toolbar-label' and text()='라이브러리']")
|
1833
|
+
el if el.displayed?
|
1834
|
+
}
|
1835
|
+
span.click
|
1836
|
+
sleep(2)
|
1837
|
+
end
|
1838
|
+
|
1839
|
+
li = wait.until {
|
1840
|
+
el = @driver.find_element(:xpath, "//li[@class='se-sidebar-item' and @data-log='llib.ditmatt' and @data-index='#{target_index}']")
|
1841
|
+
el if el.displayed?
|
1842
|
+
}
|
1843
|
+
li.click
|
1844
|
+
sleep(2)
|
1845
|
+
puts "✅ 대표 사진 #{image_nom_int} 설정 완료"
|
1846
|
+
rescue => e
|
1847
|
+
puts "❌ 대표 사진 설정 중 오류: #{e.message}"
|
1848
|
+
end
|
1849
|
+
end
|
1850
|
+
else
|
1851
|
+
|
1852
|
+
end
|
1804
1853
|
|
1805
1854
|
|
1806
1855
|
begin
|
@@ -3923,6 +3972,13 @@ class Wordpress
|
|
3923
3972
|
|
3924
3973
|
end
|
3925
3974
|
|
3975
|
+
if @data['포스트설정']['대표사진설정'].checked?
|
3976
|
+
option['대표사진설정'] = 'true'
|
3977
|
+
image_nom = @data['포스트설정']['대표사진넘버'].text.to_s.force_encoding('utf-8')
|
3978
|
+
else
|
3979
|
+
option['대표사진설정'] = 'false'
|
3980
|
+
end
|
3981
|
+
|
3926
3982
|
if @data['포스트설정']['라이브러리사용안함'].checked?
|
3927
3983
|
option['라이브러리사용안함'] = 'true'
|
3928
3984
|
else
|
@@ -4044,7 +4100,7 @@ class Wordpress
|
|
4044
4100
|
|
4045
4101
|
dd_time = @data['table'][index][10].to_s.force_encoding('utf-8').to_i
|
4046
4102
|
#template_no = @data['table'][index][7].to_s.force_encoding('utf-8').to_i
|
4047
|
-
naver.update(title,content,option,soosick_1,soosick_2, dd_time)
|
4103
|
+
naver.update(title,content,option,soosick_1,soosick_2, dd_time, image_nom)
|
4048
4104
|
|
4049
4105
|
|
4050
4106
|
# if @data['포스트설정']['태그삽입2'].checked?
|
@@ -5387,14 +5443,26 @@ class Wordpress
|
|
5387
5443
|
|
5388
5444
|
horizontal_box{
|
5389
5445
|
stretchy false
|
5390
|
-
|
5391
|
-
|
5446
|
+
grid{
|
5447
|
+
|
5448
|
+
@data['포스트설정']['대표사진설정'] = checkbox('대표 사진 지정하기'){
|
5449
|
+
top 0
|
5450
|
+
left 0
|
5451
|
+
|
5452
|
+
}
|
5453
|
+
@data['포스트설정']['대표사진넘버'] = entry{
|
5454
|
+
top 0
|
5455
|
+
left 1
|
5456
|
+
text '예로 2번째 사진이라면 2 입력'
|
5457
|
+
}
|
5458
|
+
}
|
5392
5459
|
}
|
5393
5460
|
horizontal_box{
|
5394
5461
|
stretchy false
|
5395
|
-
label('
|
5462
|
+
label('※이미지 리스트와 위 세팅을 하였다면 포스트설정1 탭에서 어떤위치(방식)으로 삽입시킬지 세팅이 필요합니다.'){
|
5396
5463
|
}
|
5397
5464
|
}
|
5465
|
+
|
5398
5466
|
vertical_separator{
|
5399
5467
|
stretchy false
|
5400
5468
|
}
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nblog_duo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 111.120.
|
4
|
+
version: 111.120.013
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- zon
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-07-
|
10
|
+
date: 2025-07-16 00:00:00.000000000 Z
|
11
11
|
dependencies: []
|
12
12
|
description: File to Clipboard gem
|
13
13
|
email: mymin26@naver.com
|