cafe_basics_duo 0.1.53 → 0.1.57
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/cafe_basics_duo.rb +68 -22
- 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: 5ba1f5e67864021ce468b7221e971657cd3bcdf861ecb356ef8fc9469d54cd50
|
4
|
+
data.tar.gz: 07e7e1bae82c7a22532023761f89288b71d1ad119a0907deb4461d3ebda8dcdc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4072b667d0174afb9b934334b6bc0754a1162a35174d13c886c10e36b678c0f30b0458c20dc4f2aadb41e9b93c1035a07ff64ef3f13826627a85e6373332951c
|
7
|
+
data.tar.gz: 0b1ea78fcc1a2585352ebf7b04e7ac1ffb5f3124f719b38846ee9dcc4cdc0c2c91e67d62c724f6084e256984ad84e4b177f8ee4f5a7e5dcc07cbc36029db80ef
|
data/lib/cafe_basics_duo.rb
CHANGED
@@ -509,19 +509,29 @@ class Naver
|
|
509
509
|
begin
|
510
510
|
wait = Selenium::WebDriver::Wait.new(:timeout => 7)
|
511
511
|
#요소가 나타날 때까지 3초 동안 기다립니다.
|
512
|
-
wait.until { @driver.find_element(:xpath, '//*[@
|
513
|
-
|
514
|
-
@driver.find_element(:xpath, '//*[@id="login_keep_wrap"]/div[1]/label').click
|
515
|
-
sleep(1.5)
|
516
|
-
@driver.find_element(:xpath, '//*[@id="id"]').click
|
512
|
+
wait.until { @driver.find_element(:xpath, '//*[@id="id" and @name="id"]') }
|
513
|
+
@driver.find_element(:xpath, '//*[@id="id" and @name="id"]').click
|
517
514
|
Clipboard.copy(user_id)
|
518
515
|
@driver.action.key_down(:control).send_keys('v').key_up(:control).perform
|
519
516
|
sleep(1.5)
|
520
|
-
@driver.find_element(:xpath, '//*[@id="pw"]').click
|
517
|
+
@driver.find_element(:xpath, '//*[@id="pw" and @name="pw"]').click
|
521
518
|
Clipboard.copy(user_pw)
|
522
519
|
@driver.action.key_down(:control).send_keys('v').key_up(:control).perform
|
523
520
|
sleep(1.5)
|
524
|
-
|
521
|
+
|
522
|
+
begin
|
523
|
+
smart_level_value = @driver.find_element(id: 'smart_LEVEL').attribute('value')
|
524
|
+
if smart_level_value == '1'
|
525
|
+
@driver.find_element(xpath: '//label[@for="switch" and @class="switch_btn"]').click
|
526
|
+
sleep(1.5)
|
527
|
+
end
|
528
|
+
rescue
|
529
|
+
end
|
530
|
+
|
531
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 3)
|
532
|
+
#요소가 나타날 때까지 3초 동안 기다립니다.
|
533
|
+
wait.until { @driver.find_element(xpath: '//button[@type="submit" and @id="log.login"]') }
|
534
|
+
@driver.find_element(xpath: '//button[@type="submit" and @id="log.login"]').click
|
525
535
|
sleep(2.5)
|
526
536
|
rescue => e
|
527
537
|
puts '-[√] 로딩 지연 접속 실패.......'.red
|
@@ -534,9 +544,8 @@ class Naver
|
|
534
544
|
puts "Failed to close tab: #{e.message}"
|
535
545
|
end
|
536
546
|
end
|
537
|
-
@driver.quit
|
538
547
|
return 0
|
539
|
-
|
548
|
+
@driver.quit
|
540
549
|
end
|
541
550
|
|
542
551
|
else
|
@@ -544,9 +553,9 @@ class Naver
|
|
544
553
|
end
|
545
554
|
|
546
555
|
begin
|
547
|
-
wait = Selenium::WebDriver::Wait.new(:timeout =>
|
556
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 5)
|
548
557
|
#요소가 나타날 때까지 3초 동안 기다립니다.
|
549
|
-
wait.until { @driver.find_element(:xpath, '//*[@class="MyView-module__btn_logout___bsTOJ"]') }
|
558
|
+
wait.until { @driver.find_element(:xpath, '//*[@type="button" and @class="MyView-module__btn_logout___bsTOJ"]') }
|
550
559
|
|
551
560
|
rescue => e
|
552
561
|
puts '-[√] 로그인 실패.......'.red
|
@@ -559,10 +568,9 @@ class Naver
|
|
559
568
|
puts "Failed to close tab: #{e.message}"
|
560
569
|
end
|
561
570
|
end
|
562
|
-
@driver.quit
|
563
571
|
return 0
|
564
|
-
|
565
|
-
end
|
572
|
+
@driver.quit
|
573
|
+
end
|
566
574
|
end
|
567
575
|
|
568
576
|
def create_id
|
@@ -3621,15 +3629,34 @@ class Wordpress
|
|
3621
3629
|
# title = content.split("\n")[0]
|
3622
3630
|
#end
|
3623
3631
|
if @data['포스트설정']['내용첫줄제목에입력'].checked?
|
3624
|
-
# 콘텐츠를 줄 단위로 분리
|
3625
3632
|
content_lines = content.split("\n")
|
3626
|
-
|
3627
|
-
|
3628
|
-
|
3629
|
-
|
3630
|
-
|
3631
|
-
|
3632
|
-
|
3633
|
+
|
3634
|
+
title = content_lines.find do |line|
|
3635
|
+
line = line.strip
|
3636
|
+
!line.empty? && !line.start_with?('<img src=')
|
3637
|
+
end
|
3638
|
+
|
3639
|
+
title ||= content_lines[1]
|
3640
|
+
|
3641
|
+
if title
|
3642
|
+
# 마침표(.) 포함 첫 문장 추출
|
3643
|
+
first_part = title[/.*?\./]
|
3644
|
+
first_part = first_part ? first_part.strip : title.strip
|
3645
|
+
|
3646
|
+
# 200bytes 제한 (한글 100자 내외)
|
3647
|
+
bytes_limit = 200
|
3648
|
+
truncated = ""
|
3649
|
+
current_bytes = 0
|
3650
|
+
|
3651
|
+
first_part.each_char do |char|
|
3652
|
+
char_bytes = char.bytesize
|
3653
|
+
break if current_bytes + char_bytes > bytes_limit
|
3654
|
+
truncated << char
|
3655
|
+
current_bytes += char_bytes
|
3656
|
+
end
|
3657
|
+
|
3658
|
+
title = truncated
|
3659
|
+
end
|
3633
3660
|
end
|
3634
3661
|
|
3635
3662
|
if @data['포스트설정']['제목을내용첫줄입력'].checked?
|
@@ -3653,6 +3680,25 @@ class Wordpress
|
|
3653
3680
|
@data['table'] << []
|
3654
3681
|
@data['table'].pop
|
3655
3682
|
|
3683
|
+
# content를 줄 단위로 쪼갬
|
3684
|
+
lines = content.lines
|
3685
|
+
|
3686
|
+
# 맨 앞부터 빈 줄(공백 또는 빈 문자열) 갯수 계산
|
3687
|
+
empty_line_count = 0
|
3688
|
+
lines.each do |line|
|
3689
|
+
if line.strip.empty?
|
3690
|
+
empty_line_count += 1
|
3691
|
+
else
|
3692
|
+
break
|
3693
|
+
end
|
3694
|
+
end
|
3695
|
+
|
3696
|
+
# 앞 빈 줄 제거
|
3697
|
+
lines = lines.drop(empty_line_count)
|
3698
|
+
|
3699
|
+
# 다시 content로 합침
|
3700
|
+
content = lines.join
|
3701
|
+
|
3656
3702
|
p option
|
3657
3703
|
|
3658
3704
|
dd_time = @data['table'][index][9].to_s.force_encoding('utf-8').to_i
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cafe_basics_duo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.57
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- zon
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-
|
10
|
+
date: 2025-07-08 00:00:00.000000000 Z
|
11
11
|
dependencies: []
|
12
12
|
description: File to Clipboard gem
|
13
13
|
email: mymin26@naver.com
|