nblog_duo 111.120.010 → 111.120.011

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/nblog_duo.rb +61 -5
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dab0b48343a27ad924161c57cc2230fbd8a00a16e137c0744b05fa46be80d367
4
- data.tar.gz: c406c6daa528d7ea66d8e8a55c725ab4d20fb069dc31438979efe840e5b8dcfa
3
+ metadata.gz: bbb7d23581635e0dc4567822425e38233d992073f18f4bb73971a37411ef317e
4
+ data.tar.gz: 1342c24281884a9c8fa4552c7cb6618217131125d781ff8345eb473e92e0b466
5
5
  SHA512:
6
- metadata.gz: 64d00d21faea55df2f58888f0ea98677ae56b82e763d35e05afbf6212475bacf9bce07df08cbd94c5503aed0ba0070c6f0ee8878849a93020d1274587566173f
7
- data.tar.gz: 1979591133b85f01d0457f9e69f5cf659e5b230d438d9cb8819c1895c8339507feed2ebe605007a6d947f87794626e5a05e5ee7604818187e70722ee7869f457
6
+ metadata.gz: 59ac574defbd7230e7bf406bb905ffd712af17061ce28507ee019cd06a8b2c3ba208bbdc26faef56618a7249f7fb332d775f1d32a5f68423e2e40da3ba99ddda
7
+ data.tar.gz: e1b76cfb061e33f0eb56b850b0577baac76f49753a7b116474847adb473a0869d25fc58a389204aacd20f14f549848f25077cb45b9e995f8244f9577bee1c82c
data/lib/nblog_duo.rb CHANGED
@@ -764,7 +764,7 @@ class Naver
764
764
  end
765
765
  end
766
766
 
767
- def update(title, content, option, soosick_1, soosick_2, dd_time)
767
+ def update(title, content, option, soosick_1, soosick_2, dd_time, image_nom)
768
768
  #@driver.get(@url+'?Redirect=Write')
769
769
  #sleep(15)
770
770
  #sleep(2)
@@ -1801,6 +1801,43 @@ class Naver
1801
1801
  else
1802
1802
 
1803
1803
  end
1804
+
1805
+ if option['대표사진설정'] == 'true'
1806
+ puts "대표 사진 설정중"
1807
+ puts "대표 사진 넘버: #{image_nom}"
1808
+
1809
+ image_nom_int = image_nom.to_i # <- 여기 추가!
1810
+
1811
+ if image_nom_int < 1
1812
+ puts "⚠️ 대표사진 넘버가 잘못되었습니다. 최소값은 1입니다."
1813
+ else
1814
+ target_index = image_nom_int - 1
1815
+ begin
1816
+ wait = Selenium::WebDriver::Wait.new(timeout: 10)
1817
+ element = @driver.find_elements(:xpath, "//strong[@class='se-panel-title' and text()='라이브러리']")
1818
+ unless element.any? && element.first.displayed?
1819
+ span = wait.until {
1820
+ el = @driver.find_element(:xpath, "//span[@class='se-toolbar-label' and text()='라이브러리']")
1821
+ el if el.displayed?
1822
+ }
1823
+ span.click
1824
+ sleep(2)
1825
+ end
1826
+
1827
+ li = wait.until {
1828
+ el = @driver.find_element(:xpath, "//li[@class='se-sidebar-item' and @data-log='llib.ditmatt' and @data-index='#{target_index}']")
1829
+ el if el.displayed?
1830
+ }
1831
+ li.click
1832
+ sleep(2)
1833
+ puts "✅ 대표 사진 #{image_nom_int} 설정 완료"
1834
+ rescue => e
1835
+ puts "❌ 대표 사진 설정 중 오류: #{e.message}"
1836
+ end
1837
+ end
1838
+ else
1839
+
1840
+ end
1804
1841
 
1805
1842
 
1806
1843
  begin
@@ -3923,6 +3960,13 @@ class Wordpress
3923
3960
 
3924
3961
  end
3925
3962
 
3963
+ if @data['포스트설정']['대표사진설정'].checked?
3964
+ option['대표사진설정'] = 'true'
3965
+ image_nom = @data['포스트설정']['대표사진넘버'].text.to_s.force_encoding('utf-8')
3966
+ else
3967
+ option['대표사진설정'] = 'false'
3968
+ end
3969
+
3926
3970
  if @data['포스트설정']['라이브러리사용안함'].checked?
3927
3971
  option['라이브러리사용안함'] = 'true'
3928
3972
  else
@@ -4044,7 +4088,7 @@ class Wordpress
4044
4088
 
4045
4089
  dd_time = @data['table'][index][10].to_s.force_encoding('utf-8').to_i
4046
4090
  #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)
4091
+ naver.update(title,content,option,soosick_1,soosick_2, dd_time, image_nom)
4048
4092
 
4049
4093
 
4050
4094
  # if @data['포스트설정']['태그삽입2'].checked?
@@ -5387,14 +5431,26 @@ class Wordpress
5387
5431
 
5388
5432
  horizontal_box{
5389
5433
  stretchy false
5390
- label('※이미지 리스트와 위 세팅을 하였다면 포스트설정1 탭에서 어떤위치(방식)으로 삽입시킬지 세팅이 필요합니다.'){
5391
- }
5434
+ grid{
5435
+
5436
+ @data['포스트설정']['대표사진설정'] = checkbox('대표 사진 지정하기'){
5437
+ top 0
5438
+ left 0
5439
+
5440
+ }
5441
+ @data['포스트설정']['대표사진넘버'] = entry{
5442
+ top 0
5443
+ left 1
5444
+ text '예로 2번째 사진이라면 2 입력'
5445
+ }
5446
+ }
5392
5447
  }
5393
5448
  horizontal_box{
5394
5449
  stretchy false
5395
- label('※이미지를 아래 특정단어 슬라이드 변경 기능만 사용한다면 포스트설정1 탭에서 설정을 필요는 없습니다.'){
5450
+ label('※이미지 리스트와 세팅을 하였다면 포스트설정1 탭에서 어떤위치(방식)으로 삽입시킬지 세팅이 필요합니다.'){
5396
5451
  }
5397
5452
  }
5453
+
5398
5454
  vertical_separator{
5399
5455
  stretchy false
5400
5456
  }
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.010
4
+ version: 111.120.011
5
5
  platform: ruby
6
6
  authors:
7
7
  - zon
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-07-09 00:00:00.000000000 Z
10
+ date: 2025-07-15 00:00:00.000000000 Z
11
11
  dependencies: []
12
12
  description: File to Clipboard gem
13
13
  email: mymin26@naver.com