nblog_duo 0.0.63 → 0.0.67
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 +34 -10
- 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: 32be681d6aa2c5ea7f576ee6a65a2743432ac7556eb7a689cbfeb91756f83c94
|
4
|
+
data.tar.gz: a568440813e460a2fd872a7d42add1edf779df54a009f0627ad1fbc6ef8e13a1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 690967f42eb6c90231410f570d4769b7a1855b631f4080691d970592846bfb826a28f154e01cda9e5c46a56241dc87197bcbe52f02015eccfcc2db24e9f8a040
|
7
|
+
data.tar.gz: 1bcb4daa76ea1d8a89bf392b00c824d50809fd984f16f408c746a2c6986190d9174d7e7e510191269ac695cdf6b14cd5dcc21ba2b32f593ae65331fa143db3e3
|
data/lib/nblog_duo.rb
CHANGED
@@ -230,8 +230,6 @@ class Naver
|
|
230
230
|
options.add_argument('--disable-gpu')
|
231
231
|
options.add_argument('--remote-debugging-port=9222')
|
232
232
|
options.add_argument('user-data-dir=C:/naver_cookie/' + user_id)
|
233
|
-
options.add_argument('--disable-blink-features=AutomationControlled') # JavaScript로 navigator.webdriver 숨기기
|
234
|
-
|
235
233
|
# 'capabilities'과 'options' 배열로 설정
|
236
234
|
capabilities = Selenium::WebDriver::Remote::Capabilities.chrome
|
237
235
|
capabilities["goog:chromeOptions"] = options.as_json
|
@@ -258,9 +256,6 @@ class Naver
|
|
258
256
|
options.add_argument('--disable-gpu')
|
259
257
|
options.add_argument('--remote-debugging-port=9222')
|
260
258
|
options.add_argument('user-data-dir=C:/naver_cookie/' + user_id)
|
261
|
-
|
262
|
-
options.add_argument('--disable-blink-features=AutomationControlled') # JavaScript로 navigator.webdriver 숨기기
|
263
|
-
|
264
259
|
# 'capabilities'과 'options' 배열로 설정
|
265
260
|
capabilities = Selenium::WebDriver::Remote::Capabilities.chrome
|
266
261
|
capabilities["goog:chromeOptions"] = options.as_json
|
@@ -284,8 +279,6 @@ class Naver
|
|
284
279
|
options.add_argument('--disable-gpu')
|
285
280
|
options.add_argument('--remote-debugging-port=9222')
|
286
281
|
options.add_argument('user-data-dir=C:/naver_cookie/' + user_id)
|
287
|
-
options.add_argument('--disable-blink-features=AutomationControlled') # JavaScript로 navigator.webdriver 숨기기
|
288
|
-
|
289
282
|
# 'capabilities'과 'options' 배열로 설정
|
290
283
|
capabilities = Selenium::WebDriver::Remote::Capabilities.chrome
|
291
284
|
capabilities["goog:chromeOptions"] = options.as_json
|
@@ -3187,11 +3180,42 @@ class Wordpress
|
|
3187
3180
|
end
|
3188
3181
|
end
|
3189
3182
|
|
3183
|
+
#if @data['포스트설정']['지도로변경'].checked?
|
3184
|
+
# @data['포스트설정']['지도로변경단어'].text.to_s.force_encoding('utf-8').split(',').each do |i|
|
3185
|
+
# content = content.split(i.force_encoding('utf-8')).join("<koreamap>"+@data['포스트설정']['지도주소'].text.to_s.force_encoding('utf-8').force_encoding('utf-8')+"</koreamap>")
|
3186
|
+
# end
|
3187
|
+
#end
|
3190
3188
|
if @data['포스트설정']['지도로변경'].checked?
|
3191
|
-
|
3192
|
-
|
3189
|
+
# 지도 주소와 사용자 설정 단어들을 가져옵니다.
|
3190
|
+
map_address = @data['포스트설정']['지도주소'].text.to_s.force_encoding('utf-8')
|
3191
|
+
|
3192
|
+
# 여러 단어로 설정된 '지도로변경단어'를 분리하여 배열로 저장
|
3193
|
+
change_words = @data['포스트설정']['지도로변경단어'].text.to_s.force_encoding('utf-8').split(',')
|
3194
|
+
|
3195
|
+
# content를 각 줄로 분할
|
3196
|
+
content_lines = content.split("\n")
|
3197
|
+
|
3198
|
+
content_lines.each_with_index do |line, index|
|
3199
|
+
# 각 단어에 대해 처리
|
3200
|
+
change_words.each do |change_word|
|
3201
|
+
# 'change_word'가 포함된 줄에 대해서만 처리
|
3202
|
+
if line.include?(change_word)
|
3203
|
+
# 설정된 단어 뒤에 괄호가 있는지 확인
|
3204
|
+
if line.include?("[") && line.include?("]")
|
3205
|
+
# 괄호 안의 주소를 찾아서 그 주소는 그대로 두고, 지도로 변경된 주소로 교체
|
3206
|
+
address_in_brackets = line.match(/\[(.*?)\]/)[1] # 괄호 안의 주소를 추출
|
3207
|
+
content_lines[index] = "<koreamap>#{address_in_brackets}</koreamap>"
|
3208
|
+
else
|
3209
|
+
# 괄호가 없다면 @data['포스트설정']['지도주소']를 추가
|
3210
|
+
content_lines[index] = "<koreamap>#{map_address}</koreamap>"
|
3211
|
+
end
|
3212
|
+
end
|
3213
|
+
end
|
3193
3214
|
end
|
3194
|
-
|
3215
|
+
|
3216
|
+
# 다시 content로 합치기
|
3217
|
+
content = content_lines.join("\n")
|
3218
|
+
end
|
3195
3219
|
|
3196
3220
|
if @data['포스트설정']['인용구변경'].checked?
|
3197
3221
|
if @data['포스트설정']['인용구문구설정'].checked?
|
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.67
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- zon
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-02-
|
11
|
+
date: 2025-02-12 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: File to Clipboard gem
|
14
14
|
email: mymin26@naver.com
|