nblog_zon 0.0.9 → 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_zon.rb +239 -271
- 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: e35ed1ed855fc1fba2f406242d3ae83764a079d374f418e97d9631143009abb7
|
4
|
+
data.tar.gz: 523852fd06a38c18599737e673a6f7ba5e807516c6bec12567467cb7abcde5c1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 33d332822b073be2607f2fdd7d045490b471c9f59349d4809a470772f5fcd6d3d90e2991bed140e26e774fd3cf1b4cb38aeddc7c0cf6af527b552b30f2adedec
|
7
|
+
data.tar.gz: 9d73eb2698fa64fb4a34b8898c30cb9f7c184d2c109e4538477054077ef8e24e161b9d1a32745c8fcc195731e0a988219ad350e7a822020ed6d529ea4eedbf9b
|
data/lib/nblog_zon.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
|
@@ -1957,7 +1912,7 @@ class Wordpress
|
|
1957
1912
|
@video = Array.new
|
1958
1913
|
while true
|
1959
1914
|
for n in 0..@data['table'].length-1
|
1960
|
-
@data['table'][n][
|
1915
|
+
@data['table'][n][11] = 0
|
1961
1916
|
end
|
1962
1917
|
|
1963
1918
|
while true
|
@@ -1995,6 +1950,17 @@ class Wordpress
|
|
1995
1950
|
rescue
|
1996
1951
|
option['bun'] = ''
|
1997
1952
|
end
|
1953
|
+
|
1954
|
+
begin
|
1955
|
+
option['template'] = table[7].to_s.force_encoding('utf-8').to_s
|
1956
|
+
if option['template'].to_s == '템플릿 사용시 번호 ex)1' || option['template'].to_s == '0'
|
1957
|
+
option['template'] = ''
|
1958
|
+
|
1959
|
+
end
|
1960
|
+
rescue
|
1961
|
+
option['template'] = ''
|
1962
|
+
end
|
1963
|
+
|
1998
1964
|
|
1999
1965
|
option['proxy'] = ''
|
2000
1966
|
if @data['포스트설정']['프록시'].checked?
|
@@ -2005,7 +1971,7 @@ class Wordpress
|
|
2005
1971
|
end
|
2006
1972
|
end
|
2007
1973
|
|
2008
|
-
if table[
|
1974
|
+
if table[8].to_i > table[11].to_i
|
2009
1975
|
if @data['포스트설정']['테더링'].checked?
|
2010
1976
|
puts 'tedering ip change...'
|
2011
1977
|
stdout, stderr, status = Open3.capture3('./adb devices')
|
@@ -2567,50 +2533,7 @@ class Wordpress
|
|
2567
2533
|
end
|
2568
2534
|
|
2569
2535
|
position = position.sort
|
2570
|
-
|
2571
|
-
# if @data['포스트설정']['내용과자동생성'].checked? or @data['포스트설정']['gpt'].checked?
|
2572
|
-
# image_url22 = get_image_file().force_encoding('utf-8')
|
2573
|
-
# end
|
2574
|
-
|
2575
|
-
# position.each do |i|
|
2576
|
-
# image_url = get_image_file().force_encoding('utf-8')
|
2577
|
-
# puts image_url
|
2578
|
-
|
2579
|
-
# puts '사진넣는위치 => '+i.to_s
|
2580
|
-
# if @data['포스트설정']['내용사진링크'].checked?
|
2581
|
-
# 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>'+""
|
2582
|
-
# content5.insert(i, '**image**')
|
2583
|
-
# else
|
2584
|
-
# image_memory << ""+'<img src="'+image_url+'" alt="'+keyword+'" class="aligncenter size-full">'+""
|
2585
|
-
# content5.insert(i, '**image**')
|
2586
|
-
# end
|
2587
|
-
# end
|
2588
|
-
|
2589
|
-
# if @data['포스트설정']['내용과자동생성'].checked? or @data['포스트설정']['gpt'].checked?
|
2590
|
-
# content = content5.join("\n")+'(자동생성글)'+content55
|
2591
|
-
# iconv = Iconv.new('UTF-8', 'ASCII-8BIT')
|
2592
|
-
# content = iconv.iconv(content)
|
2593
|
-
# content = content.encode('UTF-8', 'binary', invalid: :replace, replace: '')
|
2594
|
-
# puts content
|
2595
|
-
# image_url = image_url22
|
2596
|
-
|
2597
|
-
# if @data['포스트설정']['자동글 수식에 입력'].checked?
|
2598
|
-
|
2599
|
-
# else
|
2600
|
-
# if @data['포스트설정']['내용사진링크'].checked?
|
2601
|
-
# content = content.split('(자동생성글)')[0]+""+'<a href="'+@data['포스트설정']['내용사진링크값'].text.to_s.force_encoding('utf-8')+'"><img src="'+image_url+'" alt="'+keyword+'"></a>'+""+'(자동생성글)'+content.split('(자동생성글)')[1]
|
2602
|
-
# else
|
2603
|
-
# content = content.split('(자동생성글)')[0]+""+'<img src="'+image_url+'" alt="'+keyword+'" >'+""+'(자동생성글)'+content.split('(자동생성글)')[1]
|
2604
|
-
# end
|
2605
|
-
# end
|
2606
|
-
# else
|
2607
|
-
# content = content5.join("\n")
|
2608
|
-
# end
|
2609
|
-
# end
|
2610
|
-
# end
|
2611
|
-
###여기까지 이미지 순서대로 안되서 변경##-------------------------------------------------------------------------------
|
2612
|
-
|
2613
|
-
##여기서부터 이미지 순서대로 수정코드 변경####-------------------------------------------------------------------------------
|
2536
|
+
|
2614
2537
|
if @data['포스트설정']['내용과자동생성'].checked? or @data['포스트설정']['gpt키워드'].checked?
|
2615
2538
|
sleep(2)
|
2616
2539
|
puts '이미지 자동 세탁 중 · · · '
|
@@ -2638,6 +2561,8 @@ class Wordpress
|
|
2638
2561
|
end
|
2639
2562
|
end
|
2640
2563
|
end
|
2564
|
+
|
2565
|
+
|
2641
2566
|
##여기서부터 이미지 순서대로 수정코드 변경####-------------------------------------------------------------------------------
|
2642
2567
|
@data['table'][index][-1] = 70
|
2643
2568
|
@data['table'] << []
|
@@ -2669,12 +2594,7 @@ class Wordpress
|
|
2669
2594
|
ttr = 0
|
2670
2595
|
@data['포스트설정']['단어사진으로변경단어'].text.to_s.force_encoding('utf-8').split(',').each do |i|
|
2671
2596
|
ttr = 1
|
2672
|
-
|
2673
|
-
# if @data['포스트설정']['내용사진링크'].checked?
|
2674
|
-
# 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>')
|
2675
|
-
# else
|
2676
|
-
# content = content.split(i.force_encoding('utf-8')).join('<img src="'+image_url+'" alt="'+keyword+'">')
|
2677
|
-
# end
|
2597
|
+
|
2678
2598
|
content = content.split(i.force_encoding('utf-8'))
|
2679
2599
|
content.each_with_index do |ccm, index3|
|
2680
2600
|
if index3 == content.length-1
|
@@ -2693,6 +2613,10 @@ class Wordpress
|
|
2693
2613
|
content = content.join('')
|
2694
2614
|
end
|
2695
2615
|
end
|
2616
|
+
|
2617
|
+
|
2618
|
+
|
2619
|
+
|
2696
2620
|
|
2697
2621
|
con_memory = Array.new
|
2698
2622
|
index5 = 0
|
@@ -2733,14 +2657,6 @@ class Wordpress
|
|
2733
2657
|
|
2734
2658
|
|
2735
2659
|
|
2736
|
-
if @data['포스트설정']['내템플릿사용하기'].checked?
|
2737
|
-
@data['포스트설정']['내템플릿변경단어'].text.to_s.force_encoding('utf-8').split(',').each do |i|
|
2738
|
-
content = content.split(i.force_encoding('utf-8')).join("<template></template>")
|
2739
|
-
end
|
2740
|
-
end
|
2741
|
-
|
2742
|
-
|
2743
|
-
|
2744
2660
|
if @data['포스트설정']['영상으로변경'].checked?
|
2745
2661
|
if @video.length == 0
|
2746
2662
|
path = @data['포스트설정']['동영상폴더위치'].text.to_s.force_encoding('utf-8').force_encoding('utf-8')
|
@@ -2878,9 +2794,11 @@ class Wordpress
|
|
2878
2794
|
|
2879
2795
|
end
|
2880
2796
|
|
2881
|
-
|
2882
|
-
|
2883
|
-
|
2797
|
+
if @data['포스트설정']['라이브러리사용안함'].checked?
|
2798
|
+
option['라이브러리사용안함'] = 'true'
|
2799
|
+
else
|
2800
|
+
option['라이브러리사용안함'] = 'false'
|
2801
|
+
end
|
2884
2802
|
|
2885
2803
|
if @data['포스트설정']['외부공유허용'].checked?
|
2886
2804
|
option['외부공유허용'] = 'true'
|
@@ -2932,7 +2850,8 @@ class Wordpress
|
|
2932
2850
|
@data['table'] << []
|
2933
2851
|
@data['table'].pop
|
2934
2852
|
|
2935
|
-
dd_time = @data['table'][index][
|
2853
|
+
dd_time = @data['table'][index][10].to_s.force_encoding('utf-8').to_i
|
2854
|
+
template_no = @data['table'][index][7].to_s.force_encoding('utf-8').to_i
|
2936
2855
|
naver.update(title,content,option,soosick_1,soosick_2, dd_time)
|
2937
2856
|
|
2938
2857
|
|
@@ -2951,11 +2870,11 @@ class Wordpress
|
|
2951
2870
|
# @data2['content'] = content+'</div>'
|
2952
2871
|
|
2953
2872
|
#완료했으니 수량 카운터
|
2954
|
-
@data['table'][index][
|
2873
|
+
@data['table'][index][11] = @data['table'][index][11].to_i + 1
|
2955
2874
|
@data['table'][index][-1] = 100
|
2956
2875
|
@data['table'] << []
|
2957
2876
|
@data['table'].pop
|
2958
|
-
sleep(@data['table'][index][
|
2877
|
+
sleep(@data['table'][index][9].to_i)
|
2959
2878
|
end
|
2960
2879
|
# rescue => exception
|
2961
2880
|
# puts exception
|
@@ -3229,8 +3148,8 @@ class Wordpress
|
|
3229
3148
|
end
|
3230
3149
|
|
3231
3150
|
if i.class == Array
|
3232
|
-
i[7] = i[7].to_i
|
3233
3151
|
i[8] = i[8].to_i
|
3152
|
+
i[9] = i[9].to_i
|
3234
3153
|
@data[key] << i
|
3235
3154
|
@data[key] << i
|
3236
3155
|
@data[key].pop
|
@@ -3300,11 +3219,14 @@ class Wordpress
|
|
3300
3219
|
@data['bun'] = entry{
|
3301
3220
|
text '예약 발행 분 단위 ex)00'
|
3302
3221
|
}
|
3222
|
+
@data['template'] = entry{
|
3223
|
+
text '템플릿 사용시 번호 ex)1'
|
3224
|
+
}
|
3303
3225
|
|
3304
3226
|
button('등록'){
|
3305
3227
|
on_clicked {
|
3306
|
-
@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]
|
3307
|
-
@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]
|
3228
|
+
@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]
|
3229
|
+
@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]
|
3308
3230
|
@data['table'].pop
|
3309
3231
|
}
|
3310
3232
|
}
|
@@ -3316,8 +3238,8 @@ class Wordpress
|
|
3316
3238
|
file_data.split("\n").each do |i|
|
3317
3239
|
i3 = i.to_s.force_encoding('utf-8').to_s
|
3318
3240
|
i2 = i3.split(',')
|
3319
|
-
@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]
|
3320
|
-
@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]
|
3241
|
+
@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]
|
3242
|
+
@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]
|
3321
3243
|
@data['table'].pop
|
3322
3244
|
end
|
3323
3245
|
end
|
@@ -3352,6 +3274,9 @@ class Wordpress
|
|
3352
3274
|
text_column('예약 분'){
|
3353
3275
|
editable true
|
3354
3276
|
}
|
3277
|
+
text_column('템플릿 넘버'){
|
3278
|
+
editable true
|
3279
|
+
}
|
3355
3280
|
|
3356
3281
|
|
3357
3282
|
text_column('수량'){
|
@@ -3418,7 +3343,11 @@ class Wordpress
|
|
3418
3343
|
|
3419
3344
|
grid{
|
3420
3345
|
stretchy false
|
3421
|
-
|
3346
|
+
@data['table_template_input'] = entry{
|
3347
|
+
top 1
|
3348
|
+
left 3
|
3349
|
+
text '템플릿 넘버 ex) 3'
|
3350
|
+
}
|
3422
3351
|
@data['table_counter_input'] = entry{
|
3423
3352
|
top 1
|
3424
3353
|
left 4
|
@@ -3432,7 +3361,7 @@ class Wordpress
|
|
3432
3361
|
@data['table_delay_input2'] = entry{
|
3433
3362
|
top 1
|
3434
3363
|
left 6
|
3435
|
-
text '
|
3364
|
+
text '등록 전 딜레이'
|
3436
3365
|
}
|
3437
3366
|
|
3438
3367
|
button('전체설정'){
|
@@ -3440,9 +3369,10 @@ class Wordpress
|
|
3440
3369
|
left 7
|
3441
3370
|
on_clicked{
|
3442
3371
|
for n in 0..@data['table'].length-1
|
3443
|
-
@data['table'][n][7] = @data['
|
3444
|
-
@data['table'][n][8] = @data['
|
3445
|
-
@data['table'][n][9] = @data['
|
3372
|
+
@data['table'][n][7] = @data['table_template_input'].text.to_i
|
3373
|
+
@data['table'][n][8] = @data['table_counter_input'].text.to_i
|
3374
|
+
@data['table'][n][9] = @data['table_delay_input'].text.to_s
|
3375
|
+
@data['table'][n][10] = @data['table_delay_input2'].text.to_s
|
3446
3376
|
@data['table'] << []
|
3447
3377
|
@data['table'].pop
|
3448
3378
|
end
|
@@ -3836,20 +3766,35 @@ class Wordpress
|
|
3836
3766
|
stretchy false
|
3837
3767
|
text "내용폴더경로 ex)C:\\내용\\폴더1"
|
3838
3768
|
}
|
3839
|
-
button('폴더째로 불러오기'){
|
3840
|
-
|
3841
|
-
on_clicked{
|
3842
|
-
path = @data['이미지설정']['폴더경로2'].text.to_s.force_encoding('utf-8').force_encoding('utf-8')
|
3843
|
-
Dir.entries(@data['이미지설정']['폴더경로2'].text.to_s.force_encoding('utf-8')).each do |file|
|
3844
|
-
if file == '.' or file == '..'
|
3845
3769
|
|
3846
|
-
|
3847
|
-
|
3848
|
-
|
3770
|
+
button('폴더째로 불러오기') {
|
3771
|
+
on_clicked {
|
3772
|
+
path = @data['이미지설정']['폴더경로2'].text.to_s.force_encoding('utf-8')
|
3773
|
+
|
3774
|
+
# 경로가 유효한지 확인
|
3775
|
+
if Dir.exist?(path)
|
3776
|
+
Dir.entries(path).each do |file|
|
3777
|
+
if file == '.' or file == '..'
|
3778
|
+
next
|
3779
|
+
else
|
3780
|
+
begin
|
3781
|
+
# 파일을 열고 내용을 읽어서 추가
|
3782
|
+
file_data = File.open(path + '/' + file, 'r', encoding: 'utf-8').read
|
3783
|
+
@data['내용설정']['내용'] << [false, file, file_data]
|
3784
|
+
rescue => e
|
3785
|
+
# 파일을 열 수 없는 경우, 오류 메시지 출력
|
3786
|
+
puts "파일을 열 수 없습니다: #{file}, 오류: #{e.message}"
|
3787
|
+
end
|
3788
|
+
end
|
3849
3789
|
end
|
3790
|
+
|
3791
|
+
# 내용 배열에서 마지막 빈 항목 제거
|
3792
|
+
@data['내용설정']['내용'] << []
|
3793
|
+
@data['내용설정']['내용'].pop
|
3794
|
+
else
|
3795
|
+
# 경로가 유효하지 않을 경우, 오류 메시지 출력
|
3796
|
+
puts "경로가 존재하지 않습니다: #{path}"
|
3850
3797
|
end
|
3851
|
-
@data['내용설정']['내용'] << []
|
3852
|
-
@data['내용설정']['내용'].pop
|
3853
3798
|
}
|
3854
3799
|
}
|
3855
3800
|
}
|
@@ -3948,25 +3893,35 @@ class Wordpress
|
|
3948
3893
|
horizontal_box{
|
3949
3894
|
stretchy false
|
3950
3895
|
@data['이미지설정']['폴더경로'] = entry{
|
3951
|
-
|
3952
|
-
|
3953
|
-
|
3954
|
-
|
3955
|
-
|
3956
|
-
|
3957
|
-
|
3958
|
-
Dir.entries(@data['이미지설정']['폴더경로'].text.to_s.force_encoding('utf-8')).each do |file|
|
3959
|
-
if file == '.' or file == '..'
|
3896
|
+
stretchy false
|
3897
|
+
text "사진폴더경로 ex)C:\\사진\\폴더2"
|
3898
|
+
}
|
3899
|
+
|
3900
|
+
button('폴더째로 불러오기') {
|
3901
|
+
on_clicked {
|
3902
|
+
path = @data['이미지설정']['폴더경로'].text.to_s.force_encoding('utf-8')
|
3960
3903
|
|
3904
|
+
# 경로가 유효한지 확인
|
3905
|
+
if Dir.exist?(path)
|
3906
|
+
Dir.entries(path).each do |file|
|
3907
|
+
if file == '.' or file == '..'
|
3908
|
+
next
|
3961
3909
|
else
|
3962
|
-
|
3910
|
+
# 폴더 내의 파일을 이미지 리스트에 추가
|
3911
|
+
@data['이미지설정']['이미지'] << [false, file, path + "\\" + file.force_encoding('utf-8')]
|
3963
3912
|
end
|
3964
3913
|
end
|
3914
|
+
|
3915
|
+
# 마지막 빈 항목 추가 후 제거 (원래 로직에 맞춰)
|
3965
3916
|
@data['이미지설정']['이미지'] << []
|
3966
3917
|
@data['이미지설정']['이미지'].pop
|
3967
|
-
|
3918
|
+
else
|
3919
|
+
# 경로가 존재하지 않으면 경고 메시지 출력
|
3920
|
+
puts "경로가 존재하지 않습니다: #{path}"
|
3921
|
+
end
|
3968
3922
|
}
|
3969
3923
|
}
|
3924
|
+
}
|
3970
3925
|
|
3971
3926
|
}
|
3972
3927
|
vertical_separator{
|
@@ -4161,6 +4116,15 @@ class Wordpress
|
|
4161
4116
|
}
|
4162
4117
|
}
|
4163
4118
|
}
|
4119
|
+
vertical_separator{
|
4120
|
+
stretchy false
|
4121
|
+
}
|
4122
|
+
horizontal_box{
|
4123
|
+
stretchy false
|
4124
|
+
@data['포스트설정']['라이브러리사용안함'] = checkbox('사진 라이브러리에서 제외시키기 적용'){
|
4125
|
+
|
4126
|
+
}
|
4127
|
+
}
|
4164
4128
|
}
|
4165
4129
|
}
|
4166
4130
|
}
|
@@ -4505,7 +4469,7 @@ class Wordpress
|
|
4505
4469
|
text 'URL'
|
4506
4470
|
}
|
4507
4471
|
|
4508
|
-
@data['포스트설정']['단어사진으로변경'] = checkbox('
|
4472
|
+
@data['포스트설정']['단어사진으로변경'] = checkbox('특정단어를 사진으로 변경'){
|
4509
4473
|
top 4
|
4510
4474
|
left 0
|
4511
4475
|
}
|
@@ -4525,7 +4489,18 @@ class Wordpress
|
|
4525
4489
|
text 'URL'
|
4526
4490
|
}
|
4527
4491
|
|
4528
|
-
|
4492
|
+
|
4493
|
+
# @data['포스트설정']['슬라이드로변경'] = checkbox('특정단어를 슬라이드사진 변경'){
|
4494
|
+
# top 6
|
4495
|
+
# left 0
|
4496
|
+
# }
|
4497
|
+
# @data['포스트설정']['단어슬라이드변경'] = entry{
|
4498
|
+
# top 6
|
4499
|
+
# left 1
|
4500
|
+
# text '특정단어'
|
4501
|
+
# }
|
4502
|
+
|
4503
|
+
@data['포스트설정']['스티커로변경'] = checkbox('특정단어를 스티커로 변경'){
|
4529
4504
|
top 6
|
4530
4505
|
left 0
|
4531
4506
|
}
|
@@ -4534,7 +4509,7 @@ class Wordpress
|
|
4534
4509
|
left 1
|
4535
4510
|
text '특정단어'
|
4536
4511
|
}
|
4537
|
-
@data['포스트설정']['영상으로변경'] = checkbox('
|
4512
|
+
@data['포스트설정']['영상으로변경'] = checkbox('특정단어를 영상으로 변경'){
|
4538
4513
|
top 7
|
4539
4514
|
left 0
|
4540
4515
|
}
|
@@ -4552,7 +4527,7 @@ class Wordpress
|
|
4552
4527
|
left 1
|
4553
4528
|
text "영상폴더위치 ex) C:\\영상\\폴더3"
|
4554
4529
|
}
|
4555
|
-
@data['포스트설정']['지도로변경'] = checkbox('
|
4530
|
+
@data['포스트설정']['지도로변경'] = checkbox('특정단어를 지도로 변경'){
|
4556
4531
|
top 9
|
4557
4532
|
left 0
|
4558
4533
|
}
|
@@ -4570,7 +4545,7 @@ class Wordpress
|
|
4570
4545
|
left 1
|
4571
4546
|
text 'ex) OO시 OO구 OO동 270-68'
|
4572
4547
|
}
|
4573
|
-
@data['포스트설정']['인용구변경'] = checkbox('
|
4548
|
+
@data['포스트설정']['인용구변경'] = checkbox('특정단어를 인용구로 적용'){
|
4574
4549
|
top 11
|
4575
4550
|
left 0
|
4576
4551
|
}
|
@@ -4594,15 +4569,8 @@ class Wordpress
|
|
4594
4569
|
end
|
4595
4570
|
}
|
4596
4571
|
}
|
4597
|
-
|
4598
|
-
|
4599
|
-
left 0
|
4600
|
-
}
|
4601
|
-
@data['포스트설정']['내템플릿변경단어'] = entry{
|
4602
|
-
top 13
|
4603
|
-
left 1
|
4604
|
-
text '탬플릿으로 전활시킬 특정단어'
|
4605
|
-
}
|
4572
|
+
|
4573
|
+
|
4606
4574
|
}
|
4607
4575
|
}
|
4608
4576
|
}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nblog_zon
|
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: rnjstnswp123@naver.com
|