posting_zon 3.97.999 → 3.99.999
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/posting_zon.rb +49 -29
- 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: d6bc4eaefb7c70684f115c07f4216be732d92861a27933009851ee310abd4e5a
|
4
|
+
data.tar.gz: 1e7ca98c48b2a05f4132446fbebd8b4b0505e53561eb67d08196e06624a81066
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9cfbcdb2d8e35fac90ac8177726fe84e04a422faeedad6c41123970645c3909e2a07fa3f171371c0100b4d4f9b2b84acbe1207faa01d983d3244cb6dfb069934
|
7
|
+
data.tar.gz: 19d70e607b41a9581896c8e29008ec9311ef6667ade138dcbba08f8f8b36a77560593a97c40c97d3da431cf2af67dde72454a117b0f5df0d652920cd8a413fe1
|
data/lib/posting_zon.rb
CHANGED
@@ -11835,45 +11835,65 @@ end
|
|
11835
11835
|
|
11836
11836
|
|
11837
11837
|
begin
|
11838
|
-
|
11839
|
-
alert = wait.until { @driver.switch_to.alert }
|
11840
|
-
alert_text = alert.text
|
11841
|
-
alert.accept
|
11842
|
-
|
11838
|
+
|
11843
11839
|
banned_word = nil
|
11844
11840
|
|
11845
|
-
|
11846
|
-
|
11847
|
-
|
11841
|
+
begin
|
11842
|
+
wait = Selenium::WebDriver::Wait.new(timeout: 2)
|
11843
|
+
alert = wait.until { @driver.switch_to.alert }
|
11844
|
+
alert_text = alert.text
|
11845
|
+
alert.accept
|
11846
|
+
|
11847
|
+
# alert 메시지에서 금지단어 추출
|
11848
|
+
if alert_text =~ /금지단어\('(.+?)'\)/
|
11849
|
+
banned_word = $1
|
11850
|
+
elsif alert_text =~ /내용에\s+(.+?)\s+단어 사용이 제한/
|
11851
|
+
banned_word = $1
|
11852
|
+
elsif alert_text =~ /"(.+?)"\s*는/
|
11853
|
+
banned_word = $1
|
11854
|
+
elsif alert_text =~ /"(.+?)"/
|
11855
|
+
banned_word = $1
|
11856
|
+
elsif alert_text =~ /'(.+?)'/
|
11857
|
+
banned_word = $1
|
11858
|
+
end
|
11859
|
+
|
11848
11860
|
|
11849
|
-
|
11850
|
-
|
11851
|
-
|
11861
|
+
rescue
|
11862
|
+
begin
|
11863
|
+
wait = Selenium::WebDriver::Wait.new(timeout: 2)
|
11864
|
+
error_box = wait.until { @driver.find_element(css: '.pop-title-message') }
|
11852
11865
|
|
11853
|
-
|
11854
|
-
|
11855
|
-
banned_word = $1
|
11856
|
-
end
|
11866
|
+
# 예: <div class="pop-title-message"><div>"마케팅"</div>사용할 수 없는 단어입니다</div>pop-title-message
|
11867
|
+
text = error_box.text.strip
|
11857
11868
|
|
11858
|
-
|
11859
|
-
|
11860
|
-
|
11861
|
-
|
11862
|
-
|
11863
|
-
|
11864
|
-
retry_count += 1
|
11865
|
-
if retry_count >= max_retries
|
11866
|
-
puts "최대 재시도 횟수 초과, 중단합니다.".red
|
11867
|
-
break
|
11869
|
+
if text =~ /"(.+?)"/
|
11870
|
+
banned_word = $1
|
11871
|
+
end
|
11872
|
+
rescue
|
11873
|
+
end
|
11868
11874
|
end
|
11869
|
-
|
11870
|
-
|
11875
|
+
|
11876
|
+
|
11877
|
+
|
11878
|
+
if banned_word
|
11879
|
+
puts "금지단어 발견: [#{banned_word}]".red
|
11880
|
+
puts "[#{banned_word}] 금지단어 제거 후 재 시도 진행!!".red
|
11881
|
+
title.gsub!(banned_word, '')
|
11882
|
+
content.gsub!(banned_word, '')
|
11883
|
+
|
11884
|
+
retry_count += 1
|
11885
|
+
if retry_count >= max_retries
|
11886
|
+
puts "최대 재시도 횟수 초과, 중단합니다.".red
|
11887
|
+
break
|
11888
|
+
end
|
11889
|
+
# 루프 계속 (다음 시도)
|
11890
|
+
next
|
11871
11891
|
else
|
11872
|
-
|
11892
|
+
break # 금지단어 형식이 아니면 루프 종료
|
11873
11893
|
end
|
11874
11894
|
|
11875
11895
|
rescue
|
11876
|
-
|
11896
|
+
break # alert 자체가 없으면 루프 종료
|
11877
11897
|
end
|
11878
11898
|
|
11879
11899
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: posting_zon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.99.999
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- zon
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-05-
|
10
|
+
date: 2025-05-29 00:00:00.000000000 Z
|
11
11
|
dependencies: []
|
12
12
|
description: posting app
|
13
13
|
email: mymin26@naver.com
|