nblog_duo 0.0.7 → 0.0.10
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 +242 -273
- 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: 748229a1343202a4ae9a6f638e06bf5640da5cb0ef32679cbc743b13cecbd2b0
|
4
|
+
data.tar.gz: e106e8417ba896d4cfe216d69bd40db15d1d004601b82a3e8307df860634a341
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9949609bfd2d54b3253fac6ac224efcf9a63b38bad53741d21ae73d3186ad6d1368bf3eea7f224a6f4b1b1cbef523fb8a27790942accce400cb9f22b22d2a252
|
7
|
+
data.tar.gz: c26e0ea5dd9bcbafae3af1903b8cdedcd64b01b0d19bad31feb30852b888278ef3841ba1b7b95e021f0e07e4e08f7e16df20d0e0f22a9fe563d4740a6797425e
|
data/lib/nblog_duo.rb
CHANGED
@@ -549,7 +549,7 @@ class Naver
|
|
549
549
|
sleep(1)
|
550
550
|
@driver.switch_to.frame(@driver.find_element(:xpath, '//*[@id="mainFrame"]'))
|
551
551
|
|
552
|
-
sleep(
|
552
|
+
sleep(1)
|
553
553
|
page_data = @driver.page_source
|
554
554
|
loading_counter = 1
|
555
555
|
begin
|
@@ -568,7 +568,7 @@ class Naver
|
|
568
568
|
begin
|
569
569
|
sleep(1)
|
570
570
|
puts '[작성 중인 글이 있습니다] 팝업 체크 중 (약 10초 소요)...'
|
571
|
-
wait = Selenium::WebDriver::Wait.new(:timeout =>
|
571
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 9)
|
572
572
|
#요소가 나타날 때까지 60초 동안 기다립니다.
|
573
573
|
wait.until { @driver.find_element(:xpath, '//*[@class="se-popup-button se-popup-button-cancel"]') }
|
574
574
|
sleep(1)
|
@@ -581,8 +581,8 @@ class Naver
|
|
581
581
|
end
|
582
582
|
|
583
583
|
begin
|
584
|
-
puts '[도움말] 팝업 체크 중 (약
|
585
|
-
wait = Selenium::WebDriver::Wait.new(:timeout =>
|
584
|
+
puts '[도움말] 팝업 체크 중 (약 3초 소요)...'
|
585
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 3)
|
586
586
|
#요소가 나타날 때까지 60초 동안 기다립니다.
|
587
587
|
wait.until { @driver.find_element(:xpath, '//*[@class="se-help-panel-close-button"]') }
|
588
588
|
sleep(1)
|
@@ -594,79 +594,70 @@ class Naver
|
|
594
594
|
puts '[도움말] 팝업 팝업을 발견하지못했습니다! 다음으로 진행합니다...'
|
595
595
|
end
|
596
596
|
|
597
|
-
|
597
|
+
|
598
|
+
template = option['template']
|
599
|
+
begin
|
600
|
+
|
601
|
+
if template.to_s == ''
|
602
|
+
|
603
|
+
else
|
604
|
+
@driver.find_element(:xpath, '//*[@data-name="template"]').click
|
605
|
+
sleep(1.5)
|
606
|
+
|
607
|
+
@driver.find_element(:xpath, '//*[@data-log="ltpl.my"]').click
|
608
|
+
sleep(1)
|
609
|
+
begin
|
610
|
+
@driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/div[1]/aside/div/div[3]/div[1]/div[2]/ul/li['+template.to_s+']/a').click
|
611
|
+
puts '탬플릿 ['+template.to_s+'] 번을 사용합니다'
|
612
|
+
rescue
|
613
|
+
@driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/div[1]/aside/div/div[3]/div[1]/div[2]/ul/li/a').click
|
614
|
+
puts '탬플릿 ['+template.to_s+'] 번을 찾지못해 첫번째 탬플릿을 사용합니다.'
|
615
|
+
sleep(1)
|
616
|
+
end
|
617
|
+
@driver.switch_to.alert.accept
|
618
|
+
sleep(5)
|
619
|
+
@driver.find_element(:xpath, '//*[@data-name="template"]').click
|
620
|
+
sleep(1)
|
621
|
+
|
622
|
+
|
623
|
+
|
624
|
+
end
|
625
|
+
rescue
|
626
|
+
|
627
|
+
end
|
628
|
+
|
629
|
+
|
630
|
+
#제목 입력
|
631
|
+
ele = @driver.find_element(:xpath, '//*[@draggable="false"]')
|
598
632
|
@driver.action.click(ele).perform
|
599
|
-
sleep(
|
633
|
+
sleep(1)
|
634
|
+
@driver.action.key_down(:control).key_down('a').key_up('a').key_up(:control).perform
|
635
|
+
sleep(1)
|
636
|
+
@driver.action.key_down(:delete).key_up(:delete).perform
|
637
|
+
sleep(1)
|
600
638
|
title = title.strip
|
601
639
|
@driver.action.send_keys(title).perform
|
602
|
-
sleep(
|
640
|
+
sleep(1)
|
603
641
|
@driver.action.key_down(:enter).key_up(:enter).perform
|
604
|
-
sleep(
|
605
|
-
|
606
|
-
|
607
|
-
|
608
|
-
|
609
|
-
|
610
|
-
|
611
|
-
|
612
|
-
|
613
|
-
|
614
|
-
# category_value = category[option['category'].force_encoding('utf-8').to_s].to_s
|
615
|
-
# end
|
616
|
-
# if category_value == ''
|
617
|
-
# category_value = category[category.keys[0]].to_s
|
618
|
-
# end
|
642
|
+
sleep(1)
|
643
|
+
@driver.action.key_down(:control).key_down('a').key_up('a').key_up(:control).perform
|
644
|
+
sleep(1)
|
645
|
+
@driver.action.key_down(:down).key_up(:down).perform
|
646
|
+
@driver.action.key_down(:enter).key_up(:enter).perform
|
647
|
+
|
648
|
+
|
649
|
+
|
650
|
+
|
651
|
+
|
619
652
|
|
620
653
|
puts content
|
621
654
|
noko = Nokogiri::HTML(content, nil, Encoding::UTF_8.to_s)
|
622
655
|
toomung = 0
|
623
656
|
h = Hash.new
|
624
|
-
|
625
|
-
# h[:method] = 'POST'
|
626
|
-
# h[:path] = '/RabbitWrite.naver'
|
627
|
-
# h[:scheme] = 'https'
|
628
|
-
# h['accept'] = 'application/json, text/plain, */*'
|
629
|
-
# h['accept-encoding'] = 'gzip, deflate, br'
|
630
|
-
# h['accept-language'] = 'ko-KR,ko;q=0.9,en-US;q=0.8,en;q=0.7'
|
631
|
-
# h['content-type'] = 'application/x-www-form-urlencoded'
|
632
|
-
# h['cookie'] = @cookie
|
633
|
-
# h['origin'] = 'https://blog.naver.com'
|
634
|
-
# h['referer'] = 'https://blog.naver.com/'+@user_id+'/postwrite?categoryNo=1'
|
635
|
-
# h['sec-ch-ua'] = '"Chromium";v="106", "Google Chrome";v="106", "Not;A=Brand";v="99"'
|
636
|
-
# h['sec-ch-ua-mobile'] = '?0'
|
637
|
-
# h['sec-ch-ua-platform'] = '"Windows"'
|
638
|
-
# h['sec-fetch-dest'] = 'empty'
|
639
|
-
# h['sec-fetch-mode'] = 'cors'
|
640
|
-
# h['sec-fetch-site'] = 'same-origin'
|
641
|
-
# h['user-agent'] = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36'
|
657
|
+
|
642
658
|
|
643
659
|
data = Hash.new
|
644
|
-
|
645
|
-
# data['documentModel'] = Hash.new
|
646
|
-
# data['documentModel']['documentId'] = ''
|
647
|
-
# data['documentModel']['document'] = Hash.new
|
648
|
-
# data['documentModel']['document']['version'] = '2.6.0'
|
649
|
-
# data['documentModel']['document']['theme'] = 'default'
|
650
|
-
# data['documentModel']['document']['language'] = 'ko-KR'
|
651
|
-
# data['documentModel']['document']['components'] = Array.new
|
652
|
-
# data['documentModel']['document']['components'][0] = {
|
653
|
-
# 'id' => create_id(),
|
654
|
-
# 'layout' => 'default',
|
655
|
-
# 'title' => [
|
656
|
-
# {
|
657
|
-
# 'id' => create_id(),
|
658
|
-
# 'nodes' => [{
|
659
|
-
# 'id' => create_id(),
|
660
|
-
# 'value' => title,
|
661
|
-
# '@ctype' => 'textNode'
|
662
|
-
# }],
|
663
|
-
# '@ctype' => 'paragraph'
|
664
|
-
# }
|
665
|
-
# ],
|
666
|
-
# 'subTitle' => nil,
|
667
|
-
# 'align' => 'left',
|
668
|
-
# '@ctype' => 'documentTitle'
|
669
|
-
# }
|
660
|
+
|
670
661
|
|
671
662
|
check_position = 1
|
672
663
|
noko.css('p').each do |i|
|
@@ -707,30 +698,63 @@ class Naver
|
|
707
698
|
if i2.to_s.include?('<img')
|
708
699
|
path = i2.to_s.split('src="')[1].split('"')[0]
|
709
700
|
path = URI.decode_www_form(path)[0][0]
|
710
|
-
|
711
|
-
|
712
|
-
|
713
|
-
|
714
|
-
|
715
|
-
|
716
|
-
|
717
|
-
|
718
|
-
|
719
|
-
|
720
|
-
|
721
|
-
|
722
|
-
|
723
|
-
|
724
|
-
|
725
|
-
|
726
|
-
|
727
|
-
|
728
|
-
|
729
|
-
|
730
|
-
|
731
|
-
|
732
|
-
|
733
|
-
|
701
|
+
if option['라이브러리사용안함'] == 'true'
|
702
|
+
# 현재 탭의 URL을 가져오기
|
703
|
+
|
704
|
+
posting_url = @driver.current_url
|
705
|
+
@driver.execute_script("window.open('#{posting_url}');")
|
706
|
+
sleep(1)
|
707
|
+
@driver.switch_to.window(@driver.window_handles[1])
|
708
|
+
wait = Selenium::WebDriver::Wait.new(timeout: 10)
|
709
|
+
iframe = wait.until { @driver.find_element(id: 'mainFrame') }
|
710
|
+
@driver.switch_to.frame(iframe)
|
711
|
+
begin
|
712
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 3)
|
713
|
+
wait.until { @driver.find_element(:xpath, '//*[@class="se-popup-button-text"]') }
|
714
|
+
@driver.find_element(:xpath, '//*[@class="se-popup-button-text"]').click
|
715
|
+
sleep(1)
|
716
|
+
rescue
|
717
|
+
end
|
718
|
+
@driver.action.key_down(:control).key_down(:alt).send_keys('i').key_up(:alt).key_up(:control).perform
|
719
|
+
sleep(1)
|
720
|
+
Clipboard.copy(path.split('/').join("\\"))
|
721
|
+
key_down('ctrl')
|
722
|
+
key_stroke('v')
|
723
|
+
key_up('ctrl')
|
724
|
+
sleep(1)
|
725
|
+
key_stroke('enter')
|
726
|
+
sleep(2)
|
727
|
+
@driver.action.send_keys(:up).perform
|
728
|
+
sleep(1)
|
729
|
+
@driver.action.key_down(:control).send_keys('c').key_up(:control).perform
|
730
|
+
sleep(1)
|
731
|
+
@driver.switch_to.default_content()
|
732
|
+
@driver.close
|
733
|
+
sleep(1)
|
734
|
+
@driver.switch_to.window(@driver.window_handles[0])
|
735
|
+
wait = Selenium::WebDriver::Wait.new(timeout: 10)
|
736
|
+
iframe = wait.until { @driver.find_element(id: 'mainFrame') }
|
737
|
+
@driver.switch_to.frame(iframe)
|
738
|
+
#@driver.action.key_down(:control).send_keys('v').key_up(:control).perform
|
739
|
+
key_down('ctrl')
|
740
|
+
key_stroke('v')
|
741
|
+
key_up('ctrl')
|
742
|
+
sleep(1)
|
743
|
+
|
744
|
+
else
|
745
|
+
#@driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[1]/ul/li[1]/button').click
|
746
|
+
@driver.action.key_down(:control).key_down(:alt).send_keys('i').key_up(:alt).key_up(:control).perform
|
747
|
+
sleep(2)
|
748
|
+
Clipboard.copy(path.split('/').join("\\"))
|
749
|
+
key_down('ctrl')
|
750
|
+
key_stroke('v')
|
751
|
+
key_up('ctrl')
|
752
|
+
sleep(1)
|
753
|
+
key_stroke('enter')
|
754
|
+
sleep(2)
|
755
|
+
end
|
756
|
+
|
757
|
+
|
734
758
|
|
735
759
|
if i2.to_s.split('href="')[1] != nil
|
736
760
|
href2 = i2.to_s.split('href="')[1].split('"')[0]
|
@@ -867,75 +891,6 @@ class Naver
|
|
867
891
|
sleep(1)
|
868
892
|
|
869
893
|
|
870
|
-
elsif i2.to_s.include?('<template')
|
871
|
-
@driver.find_element(:xpath, '//*[@data-name="template"]').click
|
872
|
-
sleep(1.5)
|
873
|
-
@driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/div[1]/aside/div/div[2]/ul/li[3]/button').click
|
874
|
-
sleep(1.5)
|
875
|
-
@driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/div[1]/aside/div/div[3]/div[1]/div[2]/ul/li/a').click
|
876
|
-
sleep(1.5)
|
877
|
-
@driver.switch_to.alert.accept
|
878
|
-
sleep(5)
|
879
|
-
@driver.find_element(:xpath, '//*[@data-name="template"]').click
|
880
|
-
#sleep(1)
|
881
|
-
#@driver.find_element(:xpath, '//*[@class="save_count_btn__ZTLNa"]').click
|
882
|
-
#sleep(1)
|
883
|
-
#@driver.find_element(:xpath, '//*[@id="root"]/div/div[2]/div[2]/div[3]/div/div[2]/div[2]/div/button').click
|
884
|
-
#sleep(1)
|
885
|
-
#@driver.find_element(:xpath, '//*[@class="label__HjFsk"]').click
|
886
|
-
#sleep(1)
|
887
|
-
#@driver.find_element(:xpath, '//*[@id="root"]/div/div[2]/div[2]/div[3]/div/div[2]/div[2]/div/div/button[2]').click
|
888
|
-
#sleep(1.5)
|
889
|
-
#@driver.switch_to.alert.accept
|
890
|
-
#sleep(1.5)
|
891
|
-
#@driver.find_element(:xpath, '//*[@id="root"]/div/div[2]/div[2]/div[3]/div/div[2]/div[2]/div/div/button[3]').click
|
892
|
-
#sleep(1)
|
893
|
-
#@driver.find_element(:xpath, '//*[@class="close_button__YWXJ_"]').click
|
894
|
-
|
895
|
-
|
896
|
-
|
897
|
-
#제목 다시 입력
|
898
|
-
ele = @driver.find_element(:xpath, '//*[@draggable="false"]')
|
899
|
-
@driver.action.click(ele).perform
|
900
|
-
sleep(1)
|
901
|
-
@driver.action.key_down(:control).key_down('a').key_up('a').key_up(:control).perform
|
902
|
-
sleep(1)
|
903
|
-
@driver.action.key_down(:delete).key_up(:delete).perform
|
904
|
-
sleep(2)
|
905
|
-
title = title.strip
|
906
|
-
@driver.action.send_keys(title).perform
|
907
|
-
sleep(2)
|
908
|
-
@driver.action.key_down(:enter).key_up(:enter).perform
|
909
|
-
sleep(2)
|
910
|
-
@driver.action.key_down(:control).key_down('a').key_up('a').key_up(:control).perform
|
911
|
-
sleep(1)
|
912
|
-
@driver.action.key_down(:down).key_up(:down).perform
|
913
|
-
|
914
|
-
# components_value = Hash.new
|
915
|
-
# components_value['id'] = create_id()
|
916
|
-
# components_value['layout'] = 'default'
|
917
|
-
# begin
|
918
|
-
# if i.to_s.split('text-align: ')[1].split(';')[0] == 'center'
|
919
|
-
# components_value['align'] = 'center'
|
920
|
-
# elsif i.to_s.split('text-align: ')[1].split(';')[0] == 'right'
|
921
|
-
# components_value['align'] = 'right'
|
922
|
-
# else
|
923
|
-
|
924
|
-
# end
|
925
|
-
# rescue
|
926
|
-
|
927
|
-
# end
|
928
|
-
# sticker_random = rand(1..9)
|
929
|
-
# components_value['packCode'] = 'linesoft_01'
|
930
|
-
# components_value['seq'] = sticker_random
|
931
|
-
# components_value['thumbnail'] = {
|
932
|
-
# 'src' => "https://storep-phinf.pstatic.net/linesoft_01/original_"+sticker_random.to_s+".gif",
|
933
|
-
# "width" => 185,
|
934
|
-
# 'height' => 160,
|
935
|
-
# '@ctype' => 'thumbnail'
|
936
|
-
# }
|
937
|
-
# components_value['format'] = "animated"
|
938
|
-
# components_value['@ctype'] = "sticker"
|
939
894
|
elsif i2.to_s.include?('<koreamap')
|
940
895
|
where = i2.to_s.split('>')[1].split('<')[0]
|
941
896
|
@driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[1]/ul/li[7]/button').click
|
@@ -2026,7 +1981,7 @@ class Wordpress
|
|
2026
1981
|
@video = Array.new
|
2027
1982
|
while true
|
2028
1983
|
for n in 0..@data['table'].length-1
|
2029
|
-
@data['table'][n][
|
1984
|
+
@data['table'][n][11] = 0
|
2030
1985
|
end
|
2031
1986
|
|
2032
1987
|
while true
|
@@ -2064,6 +2019,17 @@ class Wordpress
|
|
2064
2019
|
rescue
|
2065
2020
|
option['bun'] = ''
|
2066
2021
|
end
|
2022
|
+
|
2023
|
+
begin
|
2024
|
+
option['template'] = table[7].to_s.force_encoding('utf-8').to_s
|
2025
|
+
if option['template'].to_s == '템플릿 사용시 번호 ex)1' || option['template'].to_s == '0'
|
2026
|
+
option['template'] = ''
|
2027
|
+
|
2028
|
+
end
|
2029
|
+
rescue
|
2030
|
+
option['template'] = ''
|
2031
|
+
end
|
2032
|
+
|
2067
2033
|
|
2068
2034
|
option['proxy'] = ''
|
2069
2035
|
if @data['포스트설정']['프록시'].checked?
|
@@ -2074,7 +2040,7 @@ class Wordpress
|
|
2074
2040
|
end
|
2075
2041
|
end
|
2076
2042
|
|
2077
|
-
if table[
|
2043
|
+
if table[8].to_i > table[11].to_i
|
2078
2044
|
if @data['포스트설정']['테더링'].checked?
|
2079
2045
|
puts 'tedering ip change...'
|
2080
2046
|
stdout, stderr, status = Open3.capture3('./adb devices')
|
@@ -2128,7 +2094,7 @@ class Wordpress
|
|
2128
2094
|
gpt_text1 = chat.message(title)
|
2129
2095
|
title = gpt_text1.to_s
|
2130
2096
|
end
|
2131
|
-
|
2097
|
+
|
2132
2098
|
|
2133
2099
|
@data['table'][index][-1] = 5
|
2134
2100
|
@data['table'] << []
|
@@ -2168,6 +2134,7 @@ class Wordpress
|
|
2168
2134
|
end
|
2169
2135
|
end
|
2170
2136
|
|
2137
|
+
|
2171
2138
|
if @data['포스트설정']['gpt내용'].checked?
|
2172
2139
|
api_key = @data['포스트설정']['api_key'].text.to_s.force_encoding('utf-8')
|
2173
2140
|
#key_change = @data['포스트설정']['특정단어키워드로변경값'].text.to_s.force_encoding('utf-8')
|
@@ -2184,7 +2151,7 @@ class Wordpress
|
|
2184
2151
|
gpt_text3 = chat.message(content)
|
2185
2152
|
content = gpt_text3.to_s
|
2186
2153
|
end
|
2187
|
-
|
2154
|
+
|
2188
2155
|
content_tag = content.split('@##@')[1]
|
2189
2156
|
content = content.split('@##@')[0]
|
2190
2157
|
@data['table'][index][-1] = 15
|
@@ -2635,50 +2602,7 @@ class Wordpress
|
|
2635
2602
|
end
|
2636
2603
|
|
2637
2604
|
position = position.sort
|
2638
|
-
|
2639
|
-
# if @data['포스트설정']['내용과자동생성'].checked? or @data['포스트설정']['gpt'].checked?
|
2640
|
-
# image_url22 = get_image_file().force_encoding('utf-8')
|
2641
|
-
# end
|
2642
|
-
|
2643
|
-
# position.each do |i|
|
2644
|
-
# image_url = get_image_file().force_encoding('utf-8')
|
2645
|
-
# puts image_url
|
2646
|
-
|
2647
|
-
# puts '사진넣는위치 => '+i.to_s
|
2648
|
-
# if @data['포스트설정']['내용사진링크'].checked?
|
2649
|
-
# image_memory << ""+'<a href="'+@data['포스트설정']['내용사진링크값'].text.to_s.force_encoding('utf-8').force_encoding('utf-8')+'"><img src="'+image_url+'" alt="'+keyword.force_encoding('utf-8')+'"></a>'+""
|
2650
|
-
# content5.insert(i, '**image**')
|
2651
|
-
# else
|
2652
|
-
# image_memory << ""+'<img src="'+image_url+'" alt="'+keyword+'" class="aligncenter size-full">'+""
|
2653
|
-
# content5.insert(i, '**image**')
|
2654
|
-
# end
|
2655
|
-
# end
|
2656
|
-
|
2657
|
-
# if @data['포스트설정']['내용과자동생성'].checked? or @data['포스트설정']['gpt'].checked?
|
2658
|
-
# content = content5.join("\n")+'(자동생성글)'+content55
|
2659
|
-
# iconv = Iconv.new('UTF-8', 'ASCII-8BIT')
|
2660
|
-
# content = iconv.iconv(content)
|
2661
|
-
# content = content.encode('UTF-8', 'binary', invalid: :replace, replace: '')
|
2662
|
-
# puts content
|
2663
|
-
# image_url = image_url22
|
2664
|
-
|
2665
|
-
# if @data['포스트설정']['자동글 수식에 입력'].checked?
|
2666
|
-
|
2667
|
-
# else
|
2668
|
-
# if @data['포스트설정']['내용사진링크'].checked?
|
2669
|
-
# content = content.split('(자동생성글)')[0]+""+'<a href="'+@data['포스트설정']['내용사진링크값'].text.to_s.force_encoding('utf-8')+'"><img src="'+image_url+'" alt="'+keyword+'"></a>'+""+'(자동생성글)'+content.split('(자동생성글)')[1]
|
2670
|
-
# else
|
2671
|
-
# content = content.split('(자동생성글)')[0]+""+'<img src="'+image_url+'" alt="'+keyword+'" >'+""+'(자동생성글)'+content.split('(자동생성글)')[1]
|
2672
|
-
# end
|
2673
|
-
# end
|
2674
|
-
# else
|
2675
|
-
# content = content5.join("\n")
|
2676
|
-
# end
|
2677
|
-
# end
|
2678
|
-
# end
|
2679
|
-
###여기까지 이미지 순서대로 안되서 변경##-------------------------------------------------------------------------------
|
2680
|
-
|
2681
|
-
##여기서부터 이미지 순서대로 수정코드 변경####-------------------------------------------------------------------------------
|
2605
|
+
|
2682
2606
|
if @data['포스트설정']['내용과자동생성'].checked? or @data['포스트설정']['gpt키워드'].checked?
|
2683
2607
|
sleep(2)
|
2684
2608
|
puts '이미지 자동 세탁 중 · · · '
|
@@ -2706,6 +2630,8 @@ class Wordpress
|
|
2706
2630
|
end
|
2707
2631
|
end
|
2708
2632
|
end
|
2633
|
+
|
2634
|
+
|
2709
2635
|
##여기서부터 이미지 순서대로 수정코드 변경####-------------------------------------------------------------------------------
|
2710
2636
|
@data['table'][index][-1] = 70
|
2711
2637
|
@data['table'] << []
|
@@ -2737,12 +2663,7 @@ class Wordpress
|
|
2737
2663
|
ttr = 0
|
2738
2664
|
@data['포스트설정']['단어사진으로변경단어'].text.to_s.force_encoding('utf-8').split(',').each do |i|
|
2739
2665
|
ttr = 1
|
2740
|
-
|
2741
|
-
# if @data['포스트설정']['내용사진링크'].checked?
|
2742
|
-
# content = content.split(i.force_encoding('utf-8')).join('<a href="'+@data['포스트설정']['내용사진링크값'].text.to_s.force_encoding('utf-8')+'"><img src="'+image_url+'" alt="'+keyword+'"></a>')
|
2743
|
-
# else
|
2744
|
-
# content = content.split(i.force_encoding('utf-8')).join('<img src="'+image_url+'" alt="'+keyword+'">')
|
2745
|
-
# end
|
2666
|
+
|
2746
2667
|
content = content.split(i.force_encoding('utf-8'))
|
2747
2668
|
content.each_with_index do |ccm, index3|
|
2748
2669
|
if index3 == content.length-1
|
@@ -2761,6 +2682,10 @@ class Wordpress
|
|
2761
2682
|
content = content.join('')
|
2762
2683
|
end
|
2763
2684
|
end
|
2685
|
+
|
2686
|
+
|
2687
|
+
|
2688
|
+
|
2764
2689
|
|
2765
2690
|
con_memory = Array.new
|
2766
2691
|
index5 = 0
|
@@ -2801,14 +2726,6 @@ class Wordpress
|
|
2801
2726
|
|
2802
2727
|
|
2803
2728
|
|
2804
|
-
if @data['포스트설정']['내템플릿사용하기'].checked?
|
2805
|
-
@data['포스트설정']['내템플릿변경단어'].text.to_s.force_encoding('utf-8').split(',').each do |i|
|
2806
|
-
content = content.split(i.force_encoding('utf-8')).join("<template></template>")
|
2807
|
-
end
|
2808
|
-
end
|
2809
|
-
|
2810
|
-
|
2811
|
-
|
2812
2729
|
if @data['포스트설정']['영상으로변경'].checked?
|
2813
2730
|
if @video.length == 0
|
2814
2731
|
path = @data['포스트설정']['동영상폴더위치'].text.to_s.force_encoding('utf-8').force_encoding('utf-8')
|
@@ -2946,9 +2863,11 @@ class Wordpress
|
|
2946
2863
|
|
2947
2864
|
end
|
2948
2865
|
|
2949
|
-
|
2950
|
-
|
2951
|
-
|
2866
|
+
if @data['포스트설정']['라이브러리사용안함'].checked?
|
2867
|
+
option['라이브러리사용안함'] = 'true'
|
2868
|
+
else
|
2869
|
+
option['라이브러리사용안함'] = 'false'
|
2870
|
+
end
|
2952
2871
|
|
2953
2872
|
if @data['포스트설정']['외부공유허용'].checked?
|
2954
2873
|
option['외부공유허용'] = 'true'
|
@@ -3000,7 +2919,8 @@ class Wordpress
|
|
3000
2919
|
@data['table'] << []
|
3001
2920
|
@data['table'].pop
|
3002
2921
|
|
3003
|
-
dd_time = @data['table'][index][
|
2922
|
+
dd_time = @data['table'][index][10].to_s.force_encoding('utf-8').to_i
|
2923
|
+
template_no = @data['table'][index][7].to_s.force_encoding('utf-8').to_i
|
3004
2924
|
naver.update(title,content,option,soosick_1,soosick_2, dd_time)
|
3005
2925
|
|
3006
2926
|
|
@@ -3019,11 +2939,11 @@ class Wordpress
|
|
3019
2939
|
# @data2['content'] = content+'</div>'
|
3020
2940
|
|
3021
2941
|
#완료했으니 수량 카운터
|
3022
|
-
@data['table'][index][
|
2942
|
+
@data['table'][index][11] = @data['table'][index][11].to_i + 1
|
3023
2943
|
@data['table'][index][-1] = 100
|
3024
2944
|
@data['table'] << []
|
3025
2945
|
@data['table'].pop
|
3026
|
-
sleep(@data['table'][index][
|
2946
|
+
sleep(@data['table'][index][9].to_i)
|
3027
2947
|
end
|
3028
2948
|
# rescue => exception
|
3029
2949
|
# puts exception
|
@@ -3303,8 +3223,8 @@ class Wordpress
|
|
3303
3223
|
end
|
3304
3224
|
|
3305
3225
|
if i.class == Array
|
3306
|
-
i[7] = i[7].to_i
|
3307
3226
|
i[8] = i[8].to_i
|
3227
|
+
i[9] = i[9].to_i
|
3308
3228
|
@data[key] << i
|
3309
3229
|
@data[key] << i
|
3310
3230
|
@data[key].pop
|
@@ -3374,11 +3294,14 @@ class Wordpress
|
|
3374
3294
|
@data['bun'] = entry{
|
3375
3295
|
text '예약 발행 분 단위 ex)00'
|
3376
3296
|
}
|
3297
|
+
@data['template'] = entry{
|
3298
|
+
text '템플릿 사용시 번호 ex)1'
|
3299
|
+
}
|
3377
3300
|
|
3378
3301
|
button('등록'){
|
3379
3302
|
on_clicked {
|
3380
|
-
@data['table'] << [false, @data['site_id_input'].text, @data['site_pw_input'].text,@data['category'].text , @data['proxy'].text , @data['sigan'].text, @data['bun'].text, 1, 1, 1, 0,0]
|
3381
|
-
@data['table'] << [false, @data['site_id_input'].text, @data['site_pw_input'].text,@data['category'].text , @data['proxy'].text , @data['sigan'].text, @data['bun'].text, 1, 1, 1, 0,0]
|
3303
|
+
@data['table'] << [false, @data['site_id_input'].text, @data['site_pw_input'].text,@data['category'].text , @data['proxy'].text , @data['sigan'].text, @data['bun'].text, @data['template'].text, 1, 1, 1, 0,0]
|
3304
|
+
@data['table'] << [false, @data['site_id_input'].text, @data['site_pw_input'].text,@data['category'].text , @data['proxy'].text , @data['sigan'].text, @data['bun'].text, @data['template'].text,1, 1, 1, 0,0]
|
3382
3305
|
@data['table'].pop
|
3383
3306
|
}
|
3384
3307
|
}
|
@@ -3390,8 +3313,8 @@ class Wordpress
|
|
3390
3313
|
file_data.split("\n").each do |i|
|
3391
3314
|
i3 = i.to_s.force_encoding('utf-8').to_s
|
3392
3315
|
i2 = i3.split(',')
|
3393
|
-
@data['table'] << [false, i2[0].to_s, i2[1].to_s,i2[2].to_s,i2[3].to_s,i2[4].to_s,i2[5].to_s, 1,1,1,0,0]
|
3394
|
-
@data['table'] << [false, i2[0].to_s, i2[1].to_s,i2[2].to_s,i2[3].to_s,i2[4].to_s,i2[5].to_s, 1,1,1,0,0]
|
3316
|
+
@data['table'] << [false, i2[0].to_s, i2[1].to_s,i2[2].to_s,i2[3].to_s,i2[4].to_s,i2[5].to_s,i2[6].to_s, 1,1,1,0,0]
|
3317
|
+
@data['table'] << [false, i2[0].to_s, i2[1].to_s,i2[2].to_s,i2[3].to_s,i2[4].to_s,i2[5].to_s,i2[6].to_s, 1,1,1,0,0]
|
3395
3318
|
@data['table'].pop
|
3396
3319
|
end
|
3397
3320
|
end
|
@@ -3426,6 +3349,9 @@ class Wordpress
|
|
3426
3349
|
text_column('예약 분'){
|
3427
3350
|
editable true
|
3428
3351
|
}
|
3352
|
+
text_column('템플릿 넘버'){
|
3353
|
+
editable true
|
3354
|
+
}
|
3429
3355
|
|
3430
3356
|
|
3431
3357
|
text_column('수량'){
|
@@ -3492,7 +3418,11 @@ class Wordpress
|
|
3492
3418
|
|
3493
3419
|
grid{
|
3494
3420
|
stretchy false
|
3495
|
-
|
3421
|
+
@data['table_template_input'] = entry{
|
3422
|
+
top 1
|
3423
|
+
left 3
|
3424
|
+
text '템플릿 넘버 ex) 3'
|
3425
|
+
}
|
3496
3426
|
@data['table_counter_input'] = entry{
|
3497
3427
|
top 1
|
3498
3428
|
left 4
|
@@ -3506,7 +3436,7 @@ class Wordpress
|
|
3506
3436
|
@data['table_delay_input2'] = entry{
|
3507
3437
|
top 1
|
3508
3438
|
left 6
|
3509
|
-
text '
|
3439
|
+
text '등록 전 딜레이'
|
3510
3440
|
}
|
3511
3441
|
|
3512
3442
|
button('전체설정'){
|
@@ -3514,9 +3444,10 @@ class Wordpress
|
|
3514
3444
|
left 7
|
3515
3445
|
on_clicked{
|
3516
3446
|
for n in 0..@data['table'].length-1
|
3517
|
-
@data['table'][n][7] = @data['
|
3518
|
-
@data['table'][n][8] = @data['
|
3519
|
-
@data['table'][n][9] = @data['
|
3447
|
+
@data['table'][n][7] = @data['table_template_input'].text.to_i
|
3448
|
+
@data['table'][n][8] = @data['table_counter_input'].text.to_i
|
3449
|
+
@data['table'][n][9] = @data['table_delay_input'].text.to_s
|
3450
|
+
@data['table'][n][10] = @data['table_delay_input2'].text.to_s
|
3520
3451
|
@data['table'] << []
|
3521
3452
|
@data['table'].pop
|
3522
3453
|
end
|
@@ -3910,20 +3841,35 @@ class Wordpress
|
|
3910
3841
|
stretchy false
|
3911
3842
|
text "내용폴더경로 ex)C:\\내용\\폴더1"
|
3912
3843
|
}
|
3913
|
-
button('폴더째로 불러오기'){
|
3914
|
-
|
3915
|
-
on_clicked{
|
3916
|
-
path = @data['이미지설정']['폴더경로2'].text.to_s.force_encoding('utf-8').force_encoding('utf-8')
|
3917
|
-
Dir.entries(@data['이미지설정']['폴더경로2'].text.to_s.force_encoding('utf-8')).each do |file|
|
3918
|
-
if file == '.' or file == '..'
|
3919
3844
|
|
3920
|
-
|
3921
|
-
|
3922
|
-
|
3845
|
+
button('폴더째로 불러오기') {
|
3846
|
+
on_clicked {
|
3847
|
+
path = @data['이미지설정']['폴더경로2'].text.to_s.force_encoding('utf-8')
|
3848
|
+
|
3849
|
+
# 경로가 유효한지 확인
|
3850
|
+
if Dir.exist?(path)
|
3851
|
+
Dir.entries(path).each do |file|
|
3852
|
+
if file == '.' or file == '..'
|
3853
|
+
next
|
3854
|
+
else
|
3855
|
+
begin
|
3856
|
+
# 파일을 열고 내용을 읽어서 추가
|
3857
|
+
file_data = File.open(path + '/' + file, 'r', encoding: 'utf-8').read
|
3858
|
+
@data['내용설정']['내용'] << [false, file, file_data]
|
3859
|
+
rescue => e
|
3860
|
+
# 파일을 열 수 없는 경우, 오류 메시지 출력
|
3861
|
+
puts "파일을 열 수 없습니다: #{file}, 오류: #{e.message}"
|
3862
|
+
end
|
3863
|
+
end
|
3923
3864
|
end
|
3865
|
+
|
3866
|
+
# 내용 배열에서 마지막 빈 항목 제거
|
3867
|
+
@data['내용설정']['내용'] << []
|
3868
|
+
@data['내용설정']['내용'].pop
|
3869
|
+
else
|
3870
|
+
# 경로가 유효하지 않을 경우, 오류 메시지 출력
|
3871
|
+
puts "경로가 존재하지 않습니다: #{path}"
|
3924
3872
|
end
|
3925
|
-
@data['내용설정']['내용'] << []
|
3926
|
-
@data['내용설정']['내용'].pop
|
3927
3873
|
}
|
3928
3874
|
}
|
3929
3875
|
}
|
@@ -4022,25 +3968,35 @@ class Wordpress
|
|
4022
3968
|
horizontal_box{
|
4023
3969
|
stretchy false
|
4024
3970
|
@data['이미지설정']['폴더경로'] = entry{
|
4025
|
-
|
4026
|
-
|
4027
|
-
|
4028
|
-
|
4029
|
-
|
4030
|
-
|
4031
|
-
|
4032
|
-
Dir.entries(@data['이미지설정']['폴더경로'].text.to_s.force_encoding('utf-8')).each do |file|
|
4033
|
-
if file == '.' or file == '..'
|
3971
|
+
stretchy false
|
3972
|
+
text "사진폴더경로 ex)C:\\사진\\폴더2"
|
3973
|
+
}
|
3974
|
+
|
3975
|
+
button('폴더째로 불러오기') {
|
3976
|
+
on_clicked {
|
3977
|
+
path = @data['이미지설정']['폴더경로'].text.to_s.force_encoding('utf-8')
|
4034
3978
|
|
3979
|
+
# 경로가 유효한지 확인
|
3980
|
+
if Dir.exist?(path)
|
3981
|
+
Dir.entries(path).each do |file|
|
3982
|
+
if file == '.' or file == '..'
|
3983
|
+
next
|
4035
3984
|
else
|
4036
|
-
|
3985
|
+
# 폴더 내의 파일을 이미지 리스트에 추가
|
3986
|
+
@data['이미지설정']['이미지'] << [false, file, path + "\\" + file.force_encoding('utf-8')]
|
4037
3987
|
end
|
4038
3988
|
end
|
3989
|
+
|
3990
|
+
# 마지막 빈 항목 추가 후 제거 (원래 로직에 맞춰)
|
4039
3991
|
@data['이미지설정']['이미지'] << []
|
4040
3992
|
@data['이미지설정']['이미지'].pop
|
4041
|
-
|
3993
|
+
else
|
3994
|
+
# 경로가 존재하지 않으면 경고 메시지 출력
|
3995
|
+
puts "경로가 존재하지 않습니다: #{path}"
|
3996
|
+
end
|
4042
3997
|
}
|
4043
3998
|
}
|
3999
|
+
}
|
4044
4000
|
|
4045
4001
|
}
|
4046
4002
|
vertical_separator{
|
@@ -4235,6 +4191,15 @@ class Wordpress
|
|
4235
4191
|
}
|
4236
4192
|
}
|
4237
4193
|
}
|
4194
|
+
vertical_separator{
|
4195
|
+
stretchy false
|
4196
|
+
}
|
4197
|
+
horizontal_box{
|
4198
|
+
stretchy false
|
4199
|
+
@data['포스트설정']['라이브러리사용안함'] = checkbox('사진 라이브러리에서 제외시키기 적용'){
|
4200
|
+
|
4201
|
+
}
|
4202
|
+
}
|
4238
4203
|
}
|
4239
4204
|
}
|
4240
4205
|
}
|
@@ -4579,7 +4544,7 @@ class Wordpress
|
|
4579
4544
|
text 'URL'
|
4580
4545
|
}
|
4581
4546
|
|
4582
|
-
@data['포스트설정']['단어사진으로변경'] = checkbox('
|
4547
|
+
@data['포스트설정']['단어사진으로변경'] = checkbox('특정단어를 사진으로 변경'){
|
4583
4548
|
top 4
|
4584
4549
|
left 0
|
4585
4550
|
}
|
@@ -4599,7 +4564,18 @@ class Wordpress
|
|
4599
4564
|
text 'URL'
|
4600
4565
|
}
|
4601
4566
|
|
4602
|
-
|
4567
|
+
|
4568
|
+
# @data['포스트설정']['슬라이드로변경'] = checkbox('특정단어를 슬라이드사진 변경'){
|
4569
|
+
# top 6
|
4570
|
+
# left 0
|
4571
|
+
# }
|
4572
|
+
# @data['포스트설정']['단어슬라이드변경'] = entry{
|
4573
|
+
# top 6
|
4574
|
+
# left 1
|
4575
|
+
# text '특정단어'
|
4576
|
+
# }
|
4577
|
+
|
4578
|
+
@data['포스트설정']['스티커로변경'] = checkbox('특정단어를 스티커로 변경'){
|
4603
4579
|
top 6
|
4604
4580
|
left 0
|
4605
4581
|
}
|
@@ -4608,7 +4584,7 @@ class Wordpress
|
|
4608
4584
|
left 1
|
4609
4585
|
text '특정단어'
|
4610
4586
|
}
|
4611
|
-
@data['포스트설정']['영상으로변경'] = checkbox('
|
4587
|
+
@data['포스트설정']['영상으로변경'] = checkbox('특정단어를 영상으로 변경'){
|
4612
4588
|
top 7
|
4613
4589
|
left 0
|
4614
4590
|
}
|
@@ -4626,7 +4602,7 @@ class Wordpress
|
|
4626
4602
|
left 1
|
4627
4603
|
text "영상폴더위치 ex) C:\\영상\\폴더3"
|
4628
4604
|
}
|
4629
|
-
@data['포스트설정']['지도로변경'] = checkbox('
|
4605
|
+
@data['포스트설정']['지도로변경'] = checkbox('특정단어를 지도로 변경'){
|
4630
4606
|
top 9
|
4631
4607
|
left 0
|
4632
4608
|
}
|
@@ -4644,7 +4620,7 @@ class Wordpress
|
|
4644
4620
|
left 1
|
4645
4621
|
text 'ex) OO시 OO구 OO동 270-68'
|
4646
4622
|
}
|
4647
|
-
@data['포스트설정']['인용구변경'] = checkbox('
|
4623
|
+
@data['포스트설정']['인용구변경'] = checkbox('특정단어를 인용구로 적용'){
|
4648
4624
|
top 11
|
4649
4625
|
left 0
|
4650
4626
|
}
|
@@ -4668,15 +4644,8 @@ class Wordpress
|
|
4668
4644
|
end
|
4669
4645
|
}
|
4670
4646
|
}
|
4671
|
-
|
4672
|
-
|
4673
|
-
left 0
|
4674
|
-
}
|
4675
|
-
@data['포스트설정']['내템플릿변경단어'] = entry{
|
4676
|
-
top 13
|
4677
|
-
left 1
|
4678
|
-
text '탬플릿으로 전활시킬 특정단어'
|
4679
|
-
}
|
4647
|
+
|
4648
|
+
|
4680
4649
|
}
|
4681
4650
|
}
|
4682
4651
|
}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nblog_duo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- zon
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-12-
|
11
|
+
date: 2024-12-30 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: File to Clipboard gem
|
14
14
|
email: mymin26@naver.com
|