nblog_zon 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_zon.rb +61 -5
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f1c75a34edadbd615df66a9b0287f6d4da675587304df7f5619e53e3020ebd4b
4
- data.tar.gz: 108fd1c2199517d87289b411d7f45be94e948debb440e869852ac6bc67be8603
3
+ metadata.gz: 8bf25a52968bb8e5c71a26e6f91d7b76573bdacd848adfed459107aaf06b97c2
4
+ data.tar.gz: 8f837cb7e5f4196d36faeb8bb37f9c5b3a3ddce23977a9d1b468eb6375e1566a
5
5
  SHA512:
6
- metadata.gz: 53d6dc64bd0df6911a16d95ccc7e5071e0d589b51d868eba3c0eff7ac240d61d70dc08db88181ec26a34659238b4ba7c0df817811980a30d797d9157859673c1
7
- data.tar.gz: b0f1bc844a9c6c0e32ec656993f9ce4875f93f7abeaf6d21a0d681d43f2ea282a745b3a64390c27c8a57b1f2fa5e4f6186e2c76d68f4ad096959205516b9e0f6
6
+ metadata.gz: e51b8b7ec64e77adcd135473ee25ab2ecda9ac81e662989cabc52f200067dbb8911a4ad4566ec7d9b5015b0ee770be75bc1919437d75d3b455e68e11d9e42e14
7
+ data.tar.gz: 2836a99783639fa8535676b485b5e758fd45d5eb0d2cf196cb29fc06a6e162495520e33523e66da70d62395779a6a038ec6a2eb39b02bb50da9d6e7b13f3c335
data/lib/nblog_zon.rb CHANGED
@@ -762,7 +762,7 @@ class Naver
762
762
  end
763
763
  end
764
764
 
765
- def update(title, content, option, soosick_1, soosick_2, dd_time)
765
+ def update(title, content, option, soosick_1, soosick_2, dd_time, image_nom)
766
766
  #@driver.get(@url+'?Redirect=Write')
767
767
  #sleep(15)
768
768
  #sleep(2)
@@ -1799,6 +1799,43 @@ class Naver
1799
1799
  else
1800
1800
 
1801
1801
  end
1802
+
1803
+ if option['대표사진설정'] == 'true'
1804
+ puts "대표 사진 설정중"
1805
+ puts "대표 사진 넘버: #{image_nom}"
1806
+
1807
+ image_nom_int = image_nom.to_i # <- 여기 추가!
1808
+
1809
+ if image_nom_int < 1
1810
+ puts "⚠️ 대표사진 넘버가 잘못되었습니다. 최소값은 1입니다."
1811
+ else
1812
+ target_index = image_nom_int - 1
1813
+ begin
1814
+ wait = Selenium::WebDriver::Wait.new(timeout: 10)
1815
+ element = @driver.find_elements(:xpath, "//strong[@class='se-panel-title' and text()='라이브러리']")
1816
+ unless element.any? && element.first.displayed?
1817
+ span = wait.until {
1818
+ el = @driver.find_element(:xpath, "//span[@class='se-toolbar-label' and text()='라이브러리']")
1819
+ el if el.displayed?
1820
+ }
1821
+ span.click
1822
+ sleep(2)
1823
+ end
1824
+
1825
+ li = wait.until {
1826
+ el = @driver.find_element(:xpath, "//li[@class='se-sidebar-item' and @data-log='llib.ditmatt' and @data-index='#{target_index}']")
1827
+ el if el.displayed?
1828
+ }
1829
+ li.click
1830
+ sleep(2)
1831
+ puts "✅ 대표 사진 #{image_nom_int} 설정 완료"
1832
+ rescue => e
1833
+ puts "❌ 대표 사진 설정 중 오류: #{e.message}"
1834
+ end
1835
+ end
1836
+ else
1837
+
1838
+ end
1802
1839
 
1803
1840
 
1804
1841
  begin
@@ -3852,6 +3889,13 @@ class Wordpress
3852
3889
 
3853
3890
  end
3854
3891
 
3892
+ if @data['포스트설정']['대표사진설정'].checked?
3893
+ option['대표사진설정'] = 'true'
3894
+ image_nom = @data['포스트설정']['대표사진넘버'].text.to_s.force_encoding('utf-8')
3895
+ else
3896
+ option['대표사진설정'] = 'false'
3897
+ end
3898
+
3855
3899
  if @data['포스트설정']['라이브러리사용안함'].checked?
3856
3900
  option['라이브러리사용안함'] = 'true'
3857
3901
  else
@@ -3973,7 +4017,7 @@ class Wordpress
3973
4017
 
3974
4018
  dd_time = @data['table'][index][10].to_s.force_encoding('utf-8').to_i
3975
4019
  #template_no = @data['table'][index][7].to_s.force_encoding('utf-8').to_i
3976
- naver.update(title,content,option,soosick_1,soosick_2, dd_time)
4020
+ naver.update(title,content,option,soosick_1,soosick_2, dd_time, image_nom)
3977
4021
 
3978
4022
 
3979
4023
  # if @data['포스트설정']['태그삽입2'].checked?
@@ -5310,14 +5354,26 @@ class Wordpress
5310
5354
 
5311
5355
  horizontal_box{
5312
5356
  stretchy false
5313
- label('※이미지 리스트와 위 세팅을 하였다면 포스트설정1 탭에서 어떤위치(방식)으로 삽입시킬지 세팅이 필요합니다.'){
5314
- }
5357
+ grid{
5358
+
5359
+ @data['포스트설정']['대표사진설정'] = checkbox('대표 사진 지정하기'){
5360
+ top 0
5361
+ left 0
5362
+
5363
+ }
5364
+ @data['포스트설정']['대표사진넘버'] = entry{
5365
+ top 0
5366
+ left 1
5367
+ text '예로 2번째 사진이라면 2 입력'
5368
+ }
5369
+ }
5315
5370
  }
5316
5371
  horizontal_box{
5317
5372
  stretchy false
5318
- label('※이미지를 아래 특정단어 슬라이드 변경 기능만 사용한다면 포스트설정1 탭에서 설정을 필요는 없습니다.'){
5373
+ label('※이미지 리스트와 세팅을 하였다면 포스트설정1 탭에서 어떤위치(방식)으로 삽입시킬지 세팅이 필요합니다.'){
5319
5374
  }
5320
5375
  }
5376
+
5321
5377
  vertical_separator{
5322
5378
  stretchy false
5323
5379
  }
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nblog_zon
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: rnjstnswp123@naver.com