tblog_duopack 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_duopack.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: e9106c082affaafff964c40329bc0ba565fe56e816906725deeed76882e615ea
|
4
|
+
data.tar.gz: 671c9bae7451db0e9f82107c7fae4c6ce1a2d68da23bba758e2e709f717aa5fe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 42503ab574bd63da679b53d0d223187ad4e7a33fc915783cd7ae7600bf2aedc922d305b9bc4e291a068d77d7d0fd329009b0518e980d53d454cda1635bcf8ff3
|
7
|
+
data.tar.gz: 3f943514ff41d8cc56e5fdff4be902db933b23888b3430fd0227fadc1f2a3b47279b27748606a5a09fafbf5cce96bb40f4e7788a3170c60ff015c135cff142b3
|
data/lib/tblog_duopack.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")
|
@@ -1502,10 +1522,19 @@ class Wordpress
|
|
1502
1522
|
|
1503
1523
|
def get_naver_text(q)
|
1504
1524
|
begin
|
1505
|
-
Selenium::WebDriver::Chrome::
|
1506
|
-
|
1525
|
+
options = Selenium::WebDriver::Chrome::Options.new
|
1526
|
+
# :capabilities에 options를 배열로 전달
|
1527
|
+
capabilities = [options]
|
1528
|
+
|
1529
|
+
# Selenium WebDriver에서 options를 capabilities로 전달
|
1530
|
+
@driver = Selenium::WebDriver.for(:chrome, capabilities: capabilities)
|
1507
1531
|
rescue
|
1508
|
-
|
1532
|
+
options = Selenium::WebDriver::Chrome::Options.new
|
1533
|
+
# :capabilities에 options를 배열로 전달
|
1534
|
+
capabilities = [options]
|
1535
|
+
|
1536
|
+
# Selenium WebDriver에서 options를 capabilities로 전달
|
1537
|
+
@driver = Selenium::WebDriver.for(:chrome, capabilities: capabilities)
|
1509
1538
|
end
|
1510
1539
|
@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')
|
1511
1540
|
noko = Nokogiri::HTML(@driver.page_source)
|
@@ -1535,10 +1564,19 @@ class Wordpress
|
|
1535
1564
|
|
1536
1565
|
def get_naver_text2(keyword)
|
1537
1566
|
begin
|
1538
|
-
Selenium::WebDriver::Chrome::
|
1539
|
-
|
1567
|
+
options = Selenium::WebDriver::Chrome::Options.new
|
1568
|
+
# :capabilities에 options를 배열로 전달
|
1569
|
+
capabilities = [options]
|
1570
|
+
|
1571
|
+
# Selenium WebDriver에서 options를 capabilities로 전달
|
1572
|
+
@driver = Selenium::WebDriver.for(:chrome, capabilities: capabilities)
|
1540
1573
|
rescue
|
1541
|
-
|
1574
|
+
options = Selenium::WebDriver::Chrome::Options.new
|
1575
|
+
# :capabilities에 options를 배열로 전달
|
1576
|
+
capabilities = [options]
|
1577
|
+
|
1578
|
+
# Selenium WebDriver에서 options를 capabilities로 전달
|
1579
|
+
@driver = Selenium::WebDriver.for(:chrome, capabilities: capabilities)
|
1542
1580
|
end
|
1543
1581
|
@driver.get('https://search.naver.com/search.naver?ssc=tab.blog.all&sm=tab_jum&query='+keyword.to_s)
|
1544
1582
|
for n3 in 1..10
|
@@ -1581,10 +1619,18 @@ class Wordpress
|
|
1581
1619
|
@user_pw = user_pw
|
1582
1620
|
@captcha_api_key = captcha_api_key
|
1583
1621
|
begin
|
1584
|
-
Selenium::WebDriver::Chrome::
|
1585
|
-
|
1622
|
+
options = Selenium::WebDriver::Chrome::Options.new
|
1623
|
+
# :capabilities에 options를 배열로 전달
|
1624
|
+
capabilities = [options]
|
1625
|
+
|
1626
|
+
# Selenium WebDriver에서 options를 capabilities로 전달
|
1627
|
+
@driver = Selenium::WebDriver.for(:chrome, capabilities: capabilities)
|
1586
1628
|
rescue
|
1587
|
-
|
1629
|
+
# :capabilities에 options를 배열로 전달
|
1630
|
+
capabilities = [options]
|
1631
|
+
|
1632
|
+
# Selenium WebDriver에서 options를 capabilities로 전달
|
1633
|
+
@driver = Selenium::WebDriver.for(:chrome, capabilities: capabilities)
|
1588
1634
|
end
|
1589
1635
|
end
|
1590
1636
|
|
@@ -4059,13 +4105,13 @@ class Wordpress
|
|
4059
4105
|
@data['포스트설정']['내용을자동생성'] = checkbox('키워드기반 생성으로만 등록(GPT 미 사용시 자체 생성)'){
|
4060
4106
|
top 9
|
4061
4107
|
left 0
|
4062
|
-
on_toggled{
|
4063
|
-
|
4064
|
-
|
4065
|
-
|
4066
|
-
|
4067
|
-
|
4068
|
-
|
4108
|
+
on_toggled {
|
4109
|
+
if @data['포스트설정']['내용을자동생성'].checked?
|
4110
|
+
@data['포스트설정']['내용과자동생성'].checked = false
|
4111
|
+
@data['포스트설정']['내용투명'].checked = false
|
4112
|
+
@data['포스트설정']['내용투명'].enabled = false # 비활성화
|
4113
|
+
|
4114
|
+
end
|
4069
4115
|
}
|
4070
4116
|
}
|
4071
4117
|
|
@@ -4078,13 +4124,12 @@ class Wordpress
|
|
4078
4124
|
if @data['포스트설정']['내용과자동생성'].checked?
|
4079
4125
|
@data['포스트설정']['내용을자동생성'].checked = false
|
4080
4126
|
@data['포스트설정']['내용투명'].enabled = true # '내용투명' 활성화
|
4081
|
-
|
4127
|
+
|
4082
4128
|
else
|
4083
4129
|
@data['포스트설정']['내용투명'].checked = false # 체크 해제
|
4084
4130
|
@data['포스트설정']['내용투명'].enabled = false # 비활성화
|
4085
|
-
|
4086
|
-
|
4087
|
-
end
|
4131
|
+
|
4132
|
+
end
|
4088
4133
|
}
|
4089
4134
|
}
|
4090
4135
|
|
@@ -4095,7 +4140,7 @@ class Wordpress
|
|
4095
4140
|
on_toggled {
|
4096
4141
|
if @data['포스트설정']['내용투명'].checked?
|
4097
4142
|
@data['포스트설정']['내용을자동생성'].checked = false
|
4098
|
-
|
4143
|
+
|
4099
4144
|
end
|
4100
4145
|
}
|
4101
4146
|
}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tblog_duopack
|
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
|