board_posting_duo 0.0.33 → 0.0.37

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/board_posting_duo.rb +81 -65
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1e6c5ee9d7afeb70dde0bb3608c17b1cd2fae1669db627a3a73182d7b5a0ab97
4
- data.tar.gz: b68bbd78e5342d7064741cb324584ba4f12bbfe34bef5dd697e9cd8ed165a290
3
+ metadata.gz: c51ebcc6b46612e3170b6535d6974e04257a30c8c1e92cda382e3208996b7a60
4
+ data.tar.gz: fc755aa189221204e29475a29cbc0522e9528aeb9996ef749e77915a268bc8bb
5
5
  SHA512:
6
- metadata.gz: 727bc8e37d18b1add1d71c85f8d29d65b753b27667abdbdd2d8662022e3fcb0ff14fcc094128e561beeb139814564d8741bf8426e830172f218680adaf86735d
7
- data.tar.gz: 730c71e5028dd10ab55fc7dc359913621c2dc52d805ee440d605a2b0277f8dcf7eed4e275173a54bdc828c037be3e879c37e9ada41ba245d28066e9b9949d4ad
6
+ metadata.gz: dc6c72a751df83d0ac3ff6f21c582ce5c79341ec06c9509c913bf06a29a66b4ff37cce24a7483215ba72239daa8579947be9ccb958e11cac7a16f8f56d456ae6
7
+ data.tar.gz: 993ce2194843292a7caf1c123c91a9e27b86b8729bd7ff1b2964bb5a3466df4b79e322a768a74dc2decb39fdef61a3611b44ae01439bce47bac49ecb74d9e384
@@ -41,92 +41,88 @@ class Naver
41
41
  options.page_load_strategy = :normal
42
42
  options.timeouts = {page_load: 20_000}
43
43
  options.add_argument('--start-maximized')
44
- options.add_argument('--disable-blink-features=AutomationControlled')
45
- options.add_argument('--disable-popup-blocking')
46
- options.add_argument('--dns-prefetch-disable')
47
- options.add_argument('--disable-dev-shm-usage')
48
- options.add_argument('--disable-software-rasterizer')
49
- options.add_argument('--ignore-certificate-errors')
50
- options.add_argument('--disable-gpu') # GPU가속 끄기
51
- options.excludeSwitches('enable-automation') #자동화된 테스트...제거
52
- options.add_argument('user-agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36') # user-agent 위조
53
-
54
- options.add_argument('--disable-web-security')
55
- options.add_argument('--allow-running-insecure-content')
56
- options.add_argument('--ignore-certificate-errors')
57
- options.add_argument('--allow-insecure-localhost')
58
- options.add_argument('--no-sandbox')
59
-
60
- options.add_argument('--disable-translate')
61
- options.add_argument('--disable-extensions-file-access-check')
62
- options.add_argument('--disable-impl-side-painting')
63
-
44
+ options.add_argument('user-agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.6613.85 Safari/537.36') # user-agent 위조
64
45
 
46
+ #options.add_argument('--disable-blink-features=AutomationControlled')
47
+ #options.add_argument('--disable-popup-blocking')
48
+ #options.add_argument('--dns-prefetch-disable')
49
+ #options.add_argument('--disable-dev-shm-usage')
50
+ #options.add_argument('--disable-software-rasterizer')
51
+ #options.add_argument('--ignore-certificate-errors')
52
+ #options.add_argument('--disable-gpu') # GPU가속 끄기
53
+ #options.excludeSwitches('enable-automation') #자동화된 테스트...제거
54
+ #options.add_argument('--disable-web-security')
55
+ #options.add_argument('--allow-running-insecure-content')
56
+ #options.add_argument('--ignore-certificate-errors')
57
+ #options.add_argument('--allow-insecure-localhost')
58
+ #options.add_argument('--no-sandbox')
59
+ #options.add_argument('--disable-translate')
60
+ #options.add_argument('--disable-extensions-file-access-check')
61
+ #options.add_argument('--disable-impl-side-painting')
65
62
  @driver = Selenium::WebDriver.for(:chrome, capabilities: options)
66
63
  rescue
67
64
  @driver = Selenium::WebDriver.for(:chrome, capabilities: options)
68
65
  end
69
66
  else
70
67
  begin
68
+ puts '프록시 연결합니다.......'.magenta
69
+ puts '프록시 연결시 프록시 서버에 의해 인터넷속도가 낮아질수있어.......'.magenta
70
+ puts '원활한 작업이 되지않을수있습니다.......'.magenta
71
71
  Selenium::WebDriver::Chrome::Service.driver_path = './chromedriver.exe'
72
- # profile = Selenium::WebDriver::Chrome::Profile.new
73
- # profile['network.proxy.type'] = 1
74
- # profile['network.proxy.http'] = proxy.split(':')[0]
75
- # profile['network.proxy.http_port'] = proxy.split(':')[1].to_i
76
- # options = Selenium::WebDriver::Chrome::Options.new
77
- # options.profile = profile
78
72
  options = Selenium::WebDriver::Chrome::Options.new
79
73
  options.add_argument '--proxy-server='+proxy.to_s.force_encoding('utf-8').to_s
74
+ options.add_extension('./crx/free.crx')
80
75
  options.add_extension('./crx/app.crx')
81
76
  options.page_load_strategy = :normal
82
77
  options.timeouts = {page_load: 20_000}
83
- options.add_argument('--disable-blink-features=AutomationControlled')
84
- options.add_argument('--disable-popup-blocking')
85
- options.add_argument('--dns-prefetch-disable')
86
- options.add_argument('--disable-dev-shm-usage')
87
- options.add_argument('--disable-software-rasterizer')
88
- options.add_argument('--ignore-certificate-errors')
89
- options.add_argument('--disable-gpu') # GPU가속 끄기
90
- options.excludeSwitches('enable-automation') #자동화된 테스트...제거
91
- options.add_argument('user-agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36') # user-agent 위조
92
78
  options.add_argument('--start-maximized')
93
- options.add_argument('--disable-web-security')
94
- options.add_argument('--allow-running-insecure-content')
95
- options.add_argument('--ignore-certificate-errors')
96
- options.add_argument('--allow-insecure-localhost')
97
- options.add_argument('--no-sandbox')
98
-
99
- options.add_argument('--disable-translate')
100
- options.add_argument('--disable-extensions-file-access-check')
101
- options.add_argument('--disable-impl-side-painting')
79
+ options.add_argument('user-agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.6613.85 Safari/537.36') # user-agent 위조
80
+
81
+ #options.add_argument('--disable-blink-features=AutomationControlled')
82
+ #options.add_argument('--disable-popup-blocking')
83
+ #options.add_argument('--dns-prefetch-disable')
84
+ #options.add_argument('--disable-dev-shm-usage')
85
+ #options.add_argument('--disable-software-rasterizer')
86
+ #options.add_argument('--ignore-certificate-errors')
87
+ #options.add_argument('--disable-gpu') # GPU가속 끄기
88
+ #options.excludeSwitches('enable-automation') #자동화된 테스트...제거
89
+ #options.add_argument('--disable-web-security')
90
+ #options.add_argument('--allow-running-insecure-content')
91
+ #options.add_argument('--ignore-certificate-errors')
92
+ #options.add_argument('--allow-insecure-localhost')
93
+ #options.add_argument('--no-sandbox')
94
+ #options.add_argument('--disable-translate')
95
+ #options.add_argument('--disable-extensions-file-access-check')
96
+ #options.add_argument('--disable-impl-side-painting')
102
97
  @driver = Selenium::WebDriver.for(:chrome, capabilities: options)
103
98
  rescue => e
104
99
  puts e
105
100
  puts 'proxy error...'
106
101
  begin
107
102
  Selenium::WebDriver::Chrome::Service.driver_path = './chromedriver.exe'
103
+ options.add_extension('./crx/free.crx')
108
104
  options.add_extension('./crx/app.crx')
109
105
  options.page_load_strategy = :normal
110
106
  options.timeouts = {page_load: 20_000}
111
- options.add_argument('--disable-blink-features=AutomationControlled')
112
- options.add_argument('--disable-popup-blocking')
113
- options.add_argument('--dns-prefetch-disable')
114
- options.add_argument('--disable-dev-shm-usage')
115
- options.add_argument('--disable-software-rasterizer')
116
- options.add_argument('--ignore-certificate-errors')
117
- options.add_argument('--disable-gpu') # GPU가속 끄기
118
- options.excludeSwitches('enable-automation') #자동화된 테스트...제거
119
- options.add_argument('user-agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36') # user-agent 위조
120
107
  options.add_argument('--start-maximized')
121
- options.add_argument('--disable-web-security')
122
- options.add_argument('--allow-running-insecure-content')
123
- options.add_argument('--ignore-certificate-errors')
124
- options.add_argument('--allow-insecure-localhost')
125
- options.add_argument('--no-sandbox')
126
-
127
- options.add_argument('--disable-translate')
128
- options.add_argument('--disable-extensions-file-access-check')
129
- options.add_argument('--disable-impl-side-painting')
108
+ options.add_argument('user-agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.6613.85 Safari/537.36') # user-agent 위조
109
+
110
+ #options.add_argument('--disable-blink-features=AutomationControlled')
111
+ #options.add_argument('--disable-popup-blocking')
112
+ #options.add_argument('--dns-prefetch-disable')
113
+ #options.add_argument('--disable-dev-shm-usage')
114
+ #options.add_argument('--disable-software-rasterizer')
115
+ #options.add_argument('--ignore-certificate-errors')
116
+ #options.add_argument('--disable-gpu') # GPU가속 끄기
117
+ #options.excludeSwitches('enable-automation') #자동화된 테스트...제거
118
+ #options.add_argument('--disable-web-security')
119
+ #options.add_argument('--allow-running-insecure-content')
120
+ #options.add_argument('--ignore-certificate-errors')
121
+ #options.add_argument('--allow-insecure-localhost')
122
+ #options.add_argument('--no-sandbox')
123
+ #options.add_argument('--disable-translate')
124
+ #options.add_argument('--disable-extensions-file-access-check')
125
+ #options.add_argument('--disable-impl-side-painting')
130
126
  @driver = Selenium::WebDriver.for(:chrome, capabilities: options)
131
127
  rescue
132
128
  @driver = Selenium::WebDriver.for(:chrome, capabilities: options)
@@ -3143,6 +3139,8 @@ post_url = option['post_url'].to_s
3143
3139
  rescue
3144
3140
  end
3145
3141
 
3142
+
3143
+
3146
3144
  begin
3147
3145
  # 요소 찾기 타임아웃을 10초로 설정
3148
3146
  wait = Selenium::WebDriver::Wait.new(:timeout => 20)
@@ -3168,6 +3166,25 @@ post_url = option['post_url'].to_s
3168
3166
  end
3169
3167
  end
3170
3168
 
3169
+
3170
+ begin
3171
+ sleep(1)
3172
+ puts '-[√] 글쓰기 버튼 클릭이 필수인지 탐색합니다.......'.green
3173
+ @driver.find_element(:xpath, '//*[@class="btn btn-primary btn-sm float_r"]').send_keys()
3174
+ sleep(2)
3175
+ @driver.find_element(:xpath, '//*[@class="btn btn-primary btn-sm float_r"]').click
3176
+ sleep(3)
3177
+ rescue
3178
+ begin
3179
+ @driver.find_element(:xpath, '//*[@class="fa fa-pencil"]').send_keys()
3180
+ sleep(2)
3181
+ @driver.find_element(:xpath, '//*[@class="fa fa-pencil"]').click
3182
+ sleep(3)
3183
+ rescue
3184
+ puts '-[√] 글쓰기 버튼 클릭이 필수가 아닙니다.......'.green
3185
+ end
3186
+ end
3187
+
3171
3188
  sleep(1)
3172
3189
 
3173
3190
  ##캡챠 해제 입력 코드 부분─────────────────────────────────────────────────────────────────────>
@@ -7327,10 +7344,9 @@ class Wordpress
7327
7344
  ##
7328
7345
  option['proxy'] = ''
7329
7346
  if @data['포스트설정']['프록시'].checked?
7330
- if table[6].to_i == 0
7331
- option['proxy'] = @data['포스트설정']['프록시리스트'].sample.to_s
7332
- else
7347
+ if table[8].to_i > table[10].to_i
7333
7348
  option['proxy'] = @data['포스트설정']['프록시리스트'].sample.to_s
7349
+
7334
7350
  end
7335
7351
  end
7336
7352
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: board_posting_duo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.33
4
+ version: 0.0.37
5
5
  platform: ruby
6
6
  authors:
7
7
  - soonje
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-08-27 00:00:00.000000000 Z
11
+ date: 2024-08-28 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: File to Clipboard gem
14
14
  email: rnjstnswp123@naver.com