nblog_zon 0.0.1 → 0.0.3

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 +77 -47
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: aa5c4d48c6a834677abcd2df33caeb81eef2acdbbe3e047fda027c163965e368
4
- data.tar.gz: 679ac37a4e716f119e85c04c99462950742050113c33bbf4b608684c62bda8d7
3
+ metadata.gz: b9f5449aaaf5e67d5eaa2d36a87b636d0742918011f7b9a8b569f7b2628a65a2
4
+ data.tar.gz: 230242fb01ed254dc874642ca12b81090bf996cc6f6aca5a136a10f98e4d497f
5
5
  SHA512:
6
- metadata.gz: b279fba36d6969926130fb924e3114479797eb4aac3d8d82bd6858c3af4a33c6776396a14236a80bd73b40b6418e8e4bed7964ac84654baf34f1013e5142b368
7
- data.tar.gz: f66d7437984b08c85738ca3d4973b6585e1e43d21f508649ec2b8b0e14057d7ab991dd57bbdc9ec23b483f7530e58967e59e857fca5d7d84228b6454c68b84cb
6
+ metadata.gz: 2a8a87791a0b23baeb83586cf760d57be56116d64a8c40c0c9646d6d3b1e7b9787872cd0358028d3d28dd19132357d086d30e5123d6c18c654b5275a083274d7
7
+ data.tar.gz: 6e8d8c831395a96ee5e80185dbc3b6a8875589b42356fd432bd14bdebc44613bce66f005d69881e14b77a3227885fd6d6c2011efd87c301d9c95480ff3772a70
data/lib/nblog_zon.rb CHANGED
@@ -1294,7 +1294,7 @@ class Naver
1294
1294
  sleep(3)
1295
1295
  end
1296
1296
 
1297
- @driver.find_element(:xpath, '//*[@id="root"]/div/div[1]/div/div[3]/div[3]/button').click
1297
+ @driver.find_element(:xpath, '//*[@data-focus-lock="publishLayer"]').click #1차 등록버튼
1298
1298
  sleep(3)
1299
1299
  category = option['category']
1300
1300
  begin
@@ -1302,10 +1302,10 @@ class Naver
1302
1302
  if category.to_s == ''
1303
1303
 
1304
1304
  else
1305
- @driver.find_element(:xpath, '//*[@id="root"]/div/div[1]/div/div[3]/div[3]/div/div/div/div[1]/div/div/button').click
1305
+ @driver.find_element(:xpath, '//*[@aria-label="카테고리 목록 버튼"]').click
1306
1306
  sleep(2)
1307
- for nn33 in 1..20
1308
- ele33 = @driver.find_element(:xpath, '//*[@id="root"]/div/div[1]/div/div[3]/div[3]/div/div/div/div[1]/div/div/div[3]/div/ul/li['+nn33.to_s+']/span/label')
1307
+ for nn33 in 1..20
1308
+ ele33 = @driver.find_element(:xpath, '//*[@id="root"]/div/div[1]/div/div[3]/div[2]/div/div/div/div[1]/div/div/div[2]/div/ul/li['+nn33.to_s+']/span/label')
1309
1309
  if category.include?(ele33.text)
1310
1310
  ele33.click
1311
1311
  break
@@ -1326,46 +1326,46 @@ class Naver
1326
1326
  sleep(2)
1327
1327
  # data['populationParams'] = '{"configuration":{"openType":'+option['공개']+',"commentYn":'+option['댓글허용']+',"searchYn":'+option['검색허용']+',"sympathyYn":'+option['공감허용']+',"scrapType":'+option['블로그공유']+',"outSideAllowYn":'+option['외부공유허용']+',"twitterPostingYn":false,"facebookPostingYn":false,"cclYn":false},"populationMeta":{"categoryId":'+category_value+',"logNo":null,"directorySeq":0,"directoryDetail":null,"mrBlogTalkCode":null,"postWriteTimeType":"now","tags":"'+tags2+'","moviePanelParticipation":false,"greenReviewBannerYn":false,"continueSaved":false,"noticePostYn":false,"autoByCategoryYn":false,"postLocationSupportYn":false,"postLocationJson":null,"prePostDate":null,"thisDayPostInfo":null,"scrapYn":false,"autoSaveNo":'+(Time.now.to_f.round(3)*1000).to_i.to_s+'},"editorSource":"AbZmtbYiAmhrzPJyhPXNWg=="}'
1328
1328
  if option['공개'] == '2'
1329
- @driver.find_element(:xpath ,'//*[@id="root"]/div/div[1]/div/div[3]/div[3]/div/div/div/div[3]/div/div/ul/li[1]/span/label').click
1329
+ @driver.find_element(:xpath ,'//*[@for="open_public"]').click #공개버튼
1330
1330
  elsif option['공개'] == '3'
1331
- @driver.find_element(:xpath, '//*[@id="root"]/div/div[1]/div/div[3]/div[3]/div/div/div/div[3]/div/div/ul/li[3]/span/label').click
1331
+ @driver.find_element(:xpath, '//*[@for="open_both_neighbor"]').click #서이웃 공개
1332
1332
  elsif option['공개'] == '0'
1333
- @driver.find_element(:xpath, '//*[@id="root"]/div/div[1]/div/div[3]/div[3]/div/div/div/div[3]/div/div/ul/li[4]/span/label').click
1334
- else
1335
- @driver.find_element(:xpath, '//*[@id="root"]/div/div[1]/div/div[3]/div[3]/div/div/div/div[3]/div/div/ul/li[2]/span/label').click
1333
+ @driver.find_element(:xpath, '//*[@for="open_private"]').click #비공개
1334
+ else
1335
+ @driver.find_element(:xpath, '//*[@for="open_neighbor"]').click #이웃공개
1336
1336
  end
1337
1337
 
1338
1338
  sleep(1)
1339
1339
  if option['댓글허용'] == 'true'
1340
1340
 
1341
1341
  else
1342
- @driver.find_element(:xpath, '//*[@id="root"]/div/div[1]/div/div[3]/div[3]/div/div/div/div[4]/div/div/ul/li[1]/span/label').click
1342
+ @driver.find_element(:xpath, '//*[@for="publish-option-comment"]').click
1343
1343
  end
1344
1344
  sleep(1)
1345
1345
 
1346
1346
  if option['검색허용'] == 'true'
1347
1347
 
1348
1348
  else
1349
- @driver.find_element(:xpath, '//*[@id="root"]/div/div[1]/div/div[3]/div[3]/div/div/div/div[4]/div/div/ul/li[3]/span/label').click
1349
+ @driver.find_element(:xpath, '//*[@for="publish-option-search"]').click
1350
1350
  end
1351
1351
  sleep(1)
1352
1352
 
1353
1353
  if option['공감허용'] == 'true'
1354
1354
 
1355
1355
  else
1356
- @driver.find_element(:xpath, '//*[@id="root"]/div/div[1]/div/div[3]/div[3]/div/div/div/div[4]/div/div/ul/li[2]/span/label').click
1356
+ @driver.find_element(:xpath, '//*[@for="publish-option-sympathy"]').click
1357
1357
  end
1358
1358
  sleep(1)
1359
1359
 
1360
1360
  if option['블로그공유'] == '2'
1361
1361
 
1362
1362
  else
1363
- @driver.find_element(:xpath, '//*[@id="root"]/div/div[1]/div/div[3]/div[3]/div/div/div/div[4]/div/div/ul/li[4]/span[1]/label').click
1363
+ @driver.find_element(:xpath, '//*[@for="publish-option-scrap"]').click
1364
1364
  end
1365
1365
  sleep(1)
1366
1366
 
1367
1367
  if option['외부공유허용'] == 'true'
1368
- @driver.find_element(:xpath, '//*[@id="root"]/div/div[1]/div/div[3]/div[3]/div/div/div/div[4]/div/div/ul/li[5]/span[1]/label').click
1368
+ @driver.find_element(:xpath, '//*[@for="publish-option-outside"]').click
1369
1369
  else
1370
1370
 
1371
1371
  end
@@ -1375,7 +1375,7 @@ class Naver
1375
1375
 
1376
1376
  if option['발행'] == '2' #저장
1377
1377
  sleep(dd_time.to_i)
1378
- @driver.find_element(:xpath, '//*[@id="root"]/div/div[1]/div/div[2]/button[1]').click
1378
+ @driver.find_element(:xpath, '//*[@class="save_btn__bzc5B"]').click
1379
1379
  sleep(5)
1380
1380
  elsif option['발행'] == '1' #발행
1381
1381
  sleep(dd_time.to_i)
@@ -1393,8 +1393,8 @@ class Naver
1393
1393
  sleep(2)
1394
1394
  @driver.find_element(:xpath, '//*[@title="예약 발행 시간 선택"]').click
1395
1395
  sleep(2)
1396
- for nn66 in 1..24
1397
- ele66 = @driver.find_element(:xpath, '//*[@id="root"]/div/div[1]/div/div[3]/div[3]/div/div/div/div[7]/div/div[2]/div/div[2]/select/option['+nn66.to_s+']')
1396
+ for nn66 in 1..24
1397
+ ele66 = @driver.find_element(:xpath, '//*[@id="root"]/div/div[1]/div/div[3]/div[2]/div/div/div/div[7]/div/div[2]/div/div[2]/select/option['+nn66.to_s+']')
1398
1398
  if sigan.include?(ele66.text)
1399
1399
  ele66.click
1400
1400
  break
@@ -1415,8 +1415,8 @@ class Naver
1415
1415
 
1416
1416
  @driver.find_element(:xpath, '//*[@title="예약 발행 분 선택"]').click
1417
1417
  sleep(2)
1418
- for nn77 in 1..6
1419
- ele77 = @driver.find_element(:xpath, '//*[@id="root"]/div/div[1]/div/div[3]/div[3]/div/div/div/div[7]/div/div[2]/div/div[3]/select/option['+nn77.to_s+']')
1418
+ for nn77 in 1..6
1419
+ ele77 = @driver.find_element(:xpath, '//*[@id="root"]/div/div[1]/div/div[3]/div[2]/div/div/div/div[7]/div/div[2]/div/div[3]/select/option['+nn77.to_s+']')
1420
1420
  if bun.include?(ele77.text)
1421
1421
  ele77.click
1422
1422
  break
@@ -1428,7 +1428,7 @@ class Naver
1428
1428
  puts e77
1429
1429
  end
1430
1430
 
1431
- @driver.find_element(:xpath, '//*[@id="root"]/div/div[1]/div/div[3]/div[3]/div/div/div/div[8]/div/button').click
1431
+ @driver.find_element(:xpath, '//*[@data-testid="seOnePublishBtn"]').click #최종 등록버튼
1432
1432
  sleep(7)
1433
1433
  else
1434
1434
 
@@ -2526,32 +2526,32 @@ class Wordpress
2526
2526
  end
2527
2527
 
2528
2528
  position = position.sort
2529
-
2530
- if @data['포스트설정']['내용과자동생성'].checked? or @data['포스트설정']['gpt'].checked?
2531
- image_url22 = get_image_file().force_encoding('utf-8')
2532
- end
2533
-
2534
- position.each do |i|
2535
- image_url = get_image_file().force_encoding('utf-8')
2536
- puts image_url
2537
-
2538
- puts '사진넣는위치 => '+i.to_s
2539
- if @data['포스트설정']['내용사진링크'].checked?
2540
- 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>'+""
2541
- content5.insert(i, '**image**')
2542
- else
2543
- image_memory << ""+'<img src="'+image_url+'" alt="'+keyword+'" class="aligncenter size-full">'+""
2544
- content5.insert(i, '**image**')
2545
- end
2546
- end
2547
-
2548
- if @data['포스트설정']['내용과자동생성'].checked? or @data['포스트설정']['gpt'].checked?
2549
- content = content5.join("\n")+'(자동생성글)'+content55
2529
+ ###여기까지 이미지 순서대로 안되서 변경##-------------------------------------------------------------------------------
2530
+ # if @data['포스트설정']['내용과자동생성'].checked? or @data['포스트설정']['gpt'].checked?
2531
+ # image_url22 = get_image_file().force_encoding('utf-8')
2532
+ # end
2533
+
2534
+ # position.each do |i|
2535
+ # image_url = get_image_file().force_encoding('utf-8')
2536
+ # puts image_url
2537
+
2538
+ # puts '사진넣는위치 => '+i.to_s
2539
+ # if @data['포스트설정']['내용사진링크'].checked?
2540
+ # 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>'+""
2541
+ # content5.insert(i, '**image**')
2542
+ # else
2543
+ # image_memory << ""+'<img src="'+image_url+'" alt="'+keyword+'" class="aligncenter size-full">'+""
2544
+ # content5.insert(i, '**image**')
2545
+ # end
2546
+ # end
2547
+
2548
+ # if @data['포스트설정']['내용과자동생성'].checked? or @data['포스트설정']['gpt'].checked?
2549
+ # content = content5.join("\n")+'(자동생성글)'+content55
2550
2550
  # iconv = Iconv.new('UTF-8', 'ASCII-8BIT')
2551
2551
  # content = iconv.iconv(content)
2552
2552
  # content = content.encode('UTF-8', 'binary', invalid: :replace, replace: '')
2553
- puts content
2554
- image_url = image_url22
2553
+ # puts content
2554
+ # image_url = image_url22
2555
2555
 
2556
2556
  # if @data['포스트설정']['자동글 수식에 입력'].checked?
2557
2557
 
@@ -2562,12 +2562,42 @@ class Wordpress
2562
2562
  # content = content.split('(자동생성글)')[0]+""+'<img src="'+image_url+'" alt="'+keyword+'" >'+""+'(자동생성글)'+content.split('(자동생성글)')[1]
2563
2563
  # end
2564
2564
  # end
2565
- else
2566
- content = content5.join("\n")
2567
- end
2565
+ # else
2566
+ # content = content5.join("\n")
2567
+ # end
2568
+ # end
2569
+ # end
2570
+ ###여기까지 이미지 순서대로 안되서 변경##-------------------------------------------------------------------------------
2571
+
2572
+ ##여기서부터 이미지 순서대로 수정코드 변경####-------------------------------------------------------------------------------
2573
+ if @data['포스트설정']['내용과자동생성'].checked? or @data['포스트설정']['gpt'].checked?
2574
+ sleep(2)
2575
+ puts '이미지 자동 세탁 중 · · · '
2576
+ end
2577
+ sleep(2)
2578
+ position.each do |i|
2579
+ image_url22 = get_image_file().force_encoding('utf-8')
2580
+ puts image_url22
2581
+ puts '사진넣는위치 => '+i.to_s
2582
+ if @data['포스트설정']['내용사진링크'].checked?
2583
+ image_memory << ""+'<a href="'+@data['포스트설정']['내용사진링크값'].text.to_s.force_encoding('utf-8').force_encoding('utf-8')+'"><img src="'+image_url22+'" alt="'+keyword.force_encoding('utf-8')+'"></a>'+""
2584
+ content5.insert(i, '**image**')
2585
+ else
2586
+ image_memory << ""+'<img src="'+image_url22+'" alt="'+keyword+'" class="aligncenter size-full">'+""
2587
+ content5.insert(i, '**image**')
2568
2588
  end
2569
2589
  end
2570
-
2590
+ sleep(2)
2591
+ puts '이미지 자동 세탁 완료 · · · '
2592
+ if @data['포스트설정']['내용과자동생성'].checked? or @data['포스트설정']['gpt'].checked?
2593
+ content = content5.join("\n")+'(자동생성글)'+content55
2594
+ puts content
2595
+ else
2596
+ content = content5.join("\n")
2597
+ end
2598
+ end
2599
+ end
2600
+ ##여기서부터 이미지 순서대로 수정코드 변경####-------------------------------------------------------------------------------
2571
2601
  @data['table'][index][-1] = 70
2572
2602
  @data['table'] << []
2573
2603
  @data['table'].pop
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.1
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - zon
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-10-22 00:00:00.000000000 Z
11
+ date: 2024-11-20 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: File to Clipboard gem
14
14
  email: rnjstnswp123@naver.com