tblog_zon 0.0.7 → 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/tblog_zon.rb +74 -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: e934a1fe67dbeb9f43f93928e83c3facb24d5fb180b39101fbb0c86e18f96d48
|
4
|
+
data.tar.gz: 2a1b3f6ae54dd3298de3a8b6a49f4c4de84f92d89054013f4f75caf4c2563b0e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 31378bd7520aabaf21d8ba4fe20506e3b0248d24ab587bea5e1cd9d3fe83550e57cbfb795c63f85c1c27ddf24ffd92347dc7d0a5d6ebc054bdb9eecdcfe1612b
|
7
|
+
data.tar.gz: a75da9cf8594d7fb382b22ea0470b0fd8f0ef11d66401a5b64eae6a5608332b695d9847d53e5dc785dd6a3ace08d6975a3cadf182ac0a1a9584463797dbbc701
|
data/lib/tblog_zon.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'glimmer-dsl-libui'
|
2
2
|
require 'selenium-webdriver'
|
3
|
-
|
3
|
+
require 'webdrivers'
|
4
4
|
require 'iconv'
|
5
5
|
require 'nokogiri'
|
6
6
|
require 'http'
|
@@ -211,8 +211,23 @@ class Naver
|
|
211
211
|
end
|
212
212
|
|
213
213
|
def chrome_start(proxy)
|
214
|
+
chromedriver_path = './chromedriver.exe'
|
215
|
+
|
216
|
+
# 웹드라이버 자동 업데이트 시도
|
217
|
+
begin
|
218
|
+
# webdrivers가 사용자의 Chrome 버전에 맞는 chromedriver 다운로드 시도
|
219
|
+
Webdrivers::Chromedriver.update # 자동 업데이트 시도
|
220
|
+
rescue => e
|
221
|
+
puts "webdrivers에서 chromedriver 다운로드 실패: #{e.message}"
|
222
|
+
puts "자동으로 chromedriver.exe 사용합니다."
|
223
|
+
puts "만일 프로그램 폴더안에 chromedriver.exe 버전이 맞지 않거나 없는 경우 인터넷창이 깜빡하고 닫히거나 열리지 않는경우에만 아래 안내를 따라주세요."
|
224
|
+
puts "https://storage.googleapis.com/chrome-for-testing-public/사용자크롬버전/win32/chromedriver-win32.zip 링크를 복사 후 복사 된 링크 중(사용자크롬버전) 부분을 크롬 사용자의 버전(예:131.0.6778.264)으로 수정 후 주소입력 부분에 넣어 엔터 후 다운로드 하고 압축을 풀고 chromedriver.exe 파일만 프로그램 폴더안에 넣어주세요."
|
225
|
+
puts "인터넷 창이 열리고 작업을 한다면 위 항목은 패스해주세요."
|
226
|
+
# 예외가 발생하면 수동 경로 사용
|
227
|
+
Selenium::WebDriver::Chrome::Service.driver_path = chromedriver_path
|
228
|
+
end
|
214
229
|
# 공통 옵션 설정
|
215
|
-
Selenium::WebDriver::Chrome::Service.driver_path = './chromedriver.exe'
|
230
|
+
#Selenium::WebDriver::Chrome::Service.driver_path = './chromedriver.exe'
|
216
231
|
options = Selenium::WebDriver::Chrome::Options.new
|
217
232
|
|
218
233
|
options.add_extension('./crx/app.crx') # 확장 프로그램을 첫 번째 탭에 추가
|
@@ -249,11 +264,12 @@ class Naver
|
|
249
264
|
|
250
265
|
# 브라우저 실행
|
251
266
|
begin
|
252
|
-
#
|
253
|
-
|
254
|
-
|
255
|
-
#
|
256
|
-
|
267
|
+
# :capabilities에 options를 배열로 전달
|
268
|
+
capabilities = [options]
|
269
|
+
|
270
|
+
# Selenium WebDriver에서 options를 capabilities로 전달
|
271
|
+
@driver = Selenium::WebDriver.for(:chrome, capabilities: capabilities)
|
272
|
+
|
257
273
|
|
258
274
|
sleep(1)
|
259
275
|
# 두 번째 탭에서 로그인 페이지 열기
|
@@ -264,7 +280,11 @@ class Naver
|
|
264
280
|
|
265
281
|
puts "Error: #{e.message}"
|
266
282
|
puts 'Using default Chrome driver without proxy'
|
267
|
-
|
283
|
+
# :capabilities에 options를 배열로 전달
|
284
|
+
capabilities = [options]
|
285
|
+
|
286
|
+
# Selenium WebDriver에서 options를 capabilities로 전달
|
287
|
+
@driver = Selenium::WebDriver.for(:chrome, capabilities: capabilities)
|
268
288
|
|
269
289
|
# 첫 번째 탭에서 확장 프로그램을 로드
|
270
290
|
#@driver.get("chrome-extension://ifibfemgeogfhoebkmokieepdoobkbpo/options/options.html")
|
@@ -1463,10 +1483,19 @@ class Wordpress
|
|
1463
1483
|
|
1464
1484
|
def get_naver_text(q)
|
1465
1485
|
begin
|
1466
|
-
Selenium::WebDriver::Chrome::
|
1467
|
-
|
1486
|
+
options = Selenium::WebDriver::Chrome::Options.new
|
1487
|
+
# :capabilities에 options를 배열로 전달
|
1488
|
+
capabilities = [options]
|
1489
|
+
|
1490
|
+
# Selenium WebDriver에서 options를 capabilities로 전달
|
1491
|
+
@driver = Selenium::WebDriver.for(:chrome, capabilities: capabilities)
|
1468
1492
|
rescue
|
1469
|
-
|
1493
|
+
options = Selenium::WebDriver::Chrome::Options.new
|
1494
|
+
# :capabilities에 options를 배열로 전달
|
1495
|
+
capabilities = [options]
|
1496
|
+
|
1497
|
+
# Selenium WebDriver에서 options를 capabilities로 전달
|
1498
|
+
@driver = Selenium::WebDriver.for(:chrome, capabilities: capabilities)
|
1470
1499
|
end
|
1471
1500
|
@driver.get('https://search.naver.com/search.naver?display=15&f=&filetype=0&page=3&query='+q.to_s+'&research_url=&sm=tab_pge&start=16&where=web')
|
1472
1501
|
noko = Nokogiri::HTML(@driver.page_source)
|
@@ -1496,10 +1525,19 @@ class Wordpress
|
|
1496
1525
|
|
1497
1526
|
def get_naver_text2(keyword)
|
1498
1527
|
begin
|
1499
|
-
Selenium::WebDriver::Chrome::
|
1500
|
-
|
1528
|
+
options = Selenium::WebDriver::Chrome::Options.new
|
1529
|
+
# :capabilities에 options를 배열로 전달
|
1530
|
+
capabilities = [options]
|
1531
|
+
|
1532
|
+
# Selenium WebDriver에서 options를 capabilities로 전달
|
1533
|
+
@driver = Selenium::WebDriver.for(:chrome, capabilities: capabilities)
|
1501
1534
|
rescue
|
1502
|
-
|
1535
|
+
options = Selenium::WebDriver::Chrome::Options.new
|
1536
|
+
# :capabilities에 options를 배열로 전달
|
1537
|
+
capabilities = [options]
|
1538
|
+
|
1539
|
+
# Selenium WebDriver에서 options를 capabilities로 전달
|
1540
|
+
@driver = Selenium::WebDriver.for(:chrome, capabilities: capabilities)
|
1503
1541
|
end
|
1504
1542
|
@driver.get('https://search.naver.com/search.naver?ssc=tab.blog.all&sm=tab_jum&query='+keyword.to_s)
|
1505
1543
|
for n3 in 1..10
|
@@ -1542,10 +1580,18 @@ class Wordpress
|
|
1542
1580
|
@user_pw = user_pw
|
1543
1581
|
@captcha_api_key = captcha_api_key
|
1544
1582
|
begin
|
1545
|
-
Selenium::WebDriver::Chrome::
|
1546
|
-
|
1583
|
+
options = Selenium::WebDriver::Chrome::Options.new
|
1584
|
+
# :capabilities에 options를 배열로 전달
|
1585
|
+
capabilities = [options]
|
1586
|
+
|
1587
|
+
# Selenium WebDriver에서 options를 capabilities로 전달
|
1588
|
+
@driver = Selenium::WebDriver.for(:chrome, capabilities: capabilities)
|
1547
1589
|
rescue
|
1548
|
-
|
1590
|
+
# :capabilities에 options를 배열로 전달
|
1591
|
+
capabilities = [options]
|
1592
|
+
|
1593
|
+
# Selenium WebDriver에서 options를 capabilities로 전달
|
1594
|
+
@driver = Selenium::WebDriver.for(:chrome, capabilities: capabilities)
|
1549
1595
|
end
|
1550
1596
|
end
|
1551
1597
|
|
@@ -4014,13 +4060,13 @@ class Wordpress
|
|
4014
4060
|
@data['포스트설정']['내용을자동생성'] = checkbox('키워드기반 생성으로만 등록(GPT 미 사용시 자체 생성)'){
|
4015
4061
|
top 9
|
4016
4062
|
left 0
|
4017
|
-
on_toggled{
|
4018
|
-
|
4019
|
-
|
4020
|
-
|
4021
|
-
|
4022
|
-
|
4023
|
-
|
4063
|
+
on_toggled {
|
4064
|
+
if @data['포스트설정']['내용을자동생성'].checked?
|
4065
|
+
@data['포스트설정']['내용과자동생성'].checked = false
|
4066
|
+
@data['포스트설정']['내용투명'].checked = false
|
4067
|
+
@data['포스트설정']['내용투명'].enabled = false # 비활성화
|
4068
|
+
|
4069
|
+
end
|
4024
4070
|
}
|
4025
4071
|
}
|
4026
4072
|
|
@@ -4033,13 +4079,12 @@ class Wordpress
|
|
4033
4079
|
if @data['포스트설정']['내용과자동생성'].checked?
|
4034
4080
|
@data['포스트설정']['내용을자동생성'].checked = false
|
4035
4081
|
@data['포스트설정']['내용투명'].enabled = true # '내용투명' 활성화
|
4036
|
-
|
4082
|
+
|
4037
4083
|
else
|
4038
4084
|
@data['포스트설정']['내용투명'].checked = false # 체크 해제
|
4039
4085
|
@data['포스트설정']['내용투명'].enabled = false # 비활성화
|
4040
|
-
|
4041
|
-
|
4042
|
-
end
|
4086
|
+
|
4087
|
+
end
|
4043
4088
|
}
|
4044
4089
|
}
|
4045
4090
|
|
@@ -4050,7 +4095,7 @@ class Wordpress
|
|
4050
4095
|
on_toggled {
|
4051
4096
|
if @data['포스트설정']['내용투명'].checked?
|
4052
4097
|
@data['포스트설정']['내용을자동생성'].checked = false
|
4053
|
-
|
4098
|
+
|
4054
4099
|
end
|
4055
4100
|
}
|
4056
4101
|
}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tblog_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:
|
11
|
+
date: 2025-01-10 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: File to Clipboard gem
|
14
14
|
email: mymin26@naver.com
|