cafe_basics_duo 0.0.21 → 0.0.27

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/cafe_basics_duo.rb +71 -57
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 679b20ad6abad03f4d7fe1678328d1b47d20236fe017a44adaa5b01f0d4015af
4
- data.tar.gz: 481550c7b0decb19d722cdfde237929ba0d1e9b8e540a1188a0a66905cca53b5
3
+ metadata.gz: 050c6349e1735f96d044a63d73633670030511155dac0584dd6aab4fd174a963
4
+ data.tar.gz: c7fddf848024c13c58b404d907d3648d2414e08dbbaca2cf37fa12344dac15c7
5
5
  SHA512:
6
- metadata.gz: ce479dc58f5a40f48f51d67387968159f4302a71f35a78c690aec05025f9eff10efc990c72ce899dcf63773be1380f80db175fa511543b0d1f32a72dba083541
7
- data.tar.gz: bf5eb2bf7640dd95936a05b15b545b6c3430a4762983fdf5c07543c4357d1d79f2c9ce72955bc3e2675059aaf7a9305bf386c13193969863d38c3d267147ca92
6
+ metadata.gz: 7187de0dfd71d1c66796d53ce8e2c5b783a8be82d46ab7f22106e5b300ec5d621f4a41b5e68b73b6e62bfefd75f76375f0f92cc9a19e6b6b37633c00ee83b4fa
7
+ data.tar.gz: 7a8275aa4129fea7bfc85252abf54539c2dbb8f7a4aac8b491de7d41391adcca0cb623c70d4136343e32cc96c0ca1b9ab8ab4b97b27a8f280af45e861512899d
@@ -210,11 +210,14 @@ class Naver
210
210
  def initialize
211
211
  @seed = 1
212
212
  end
213
- def chrome_setup(user_id)
213
+ def chrome_setup(user_id, proxy)
214
214
  naver_cookie_dir = "C:/naver_cookie"
215
215
  FileUtils.mkdir_p(naver_cookie_dir) unless File.exist?(naver_cookie_dir)
216
+ if proxy == ''
216
217
  system(%{"C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe" https://naver.com/ --remote-debugging-port=9222 --user-data-dir=C:/naver_cookie/#{user_id}})
217
-
218
+ else
219
+ system(%{"C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe" "https://naver.com/" --remote-debugging-port=9222 --user-data-dir=C:/naver_cookie/#{user_id} --proxy-server=#{proxy.to_s.force_encoding('utf-8').to_s}})
220
+ end
218
221
  end
219
222
  def chrome_start(proxy, user_id)
220
223
  naver_cookie_dir = "C:/naver_cookie"
@@ -295,7 +298,7 @@ class Naver
295
298
  end
296
299
 
297
300
  # 새로운 스레드 생성 및 실행
298
- Thread.new { chrome_setup(user_id) }
301
+ Thread.new { chrome_setup(user_id, proxy) }
299
302
  sleep(3)
300
303
 
301
304
 
@@ -1247,11 +1250,11 @@ class Naver
1247
1250
  end
1248
1251
  end
1249
1252
  end
1250
- sleep(1)
1253
+ sleep(0.5)
1251
1254
  @driver.action.key_down(:end).key_up(:end).perform
1252
- sleep(1)
1255
+ sleep(0.5)
1253
1256
  @driver.action.key_down(:enter).key_up(:enter).perform
1254
- sleep(1)
1257
+ sleep(0.5)
1255
1258
  # if check_image == 0
1256
1259
  # if value_data['nodes'].length == 0
1257
1260
  # value_data['nodes'][0] = {
@@ -1350,88 +1353,97 @@ class Naver
1350
1353
  tag_mm2 << ''+tag_value
1351
1354
  end
1352
1355
  @driver.find_element(:xpath, '//*[@placeholder="태그를 입력해주세요 (최대 10개)"]').send_keys(tag_mm2.join("\n")+"\n")
1356
+
1353
1357
  sleep(1)
1354
- # data['populationParams'] = '{"configuration":{"openType":'+option['공개']+',"commentYn":'+option['댓글허용']+',"searchYn":'+option['검색허용']+',"sympathyYn":'+option['공감허용']+',"scrapType":'+option['블로그공유']+',"outSideAllowYn":'+option['외부공유허용']+',"twitterPostingYn":false,"facebookPostingYn":false,"cclYn":false},"populationMeta":{"categoryId":'+category_value+',"logNo":null,"directorySeq":0,"directoryDetail":null,"mrBlogTalkCode":null,"postWriteTimeType":"now","tags":"'+tags2+'","moviePanelParticipation":false,"greenReviewBannerYn":false,"continueSaved":false,"noticePostYn":false,"autoByCategoryYn":false,"postLocationSupportYn":false,"postLocationJson":null,"prePostDate":null,"thisDayPostInfo":null,"scrapYn":false,"autoSaveNo":'+(Time.now.to_f.round(3)*1000).to_i.to_s+'},"editorSource":"AbZmtbYiAmhrzPJyhPXNWg=="}'
1355
- # if option['공개'] == '2'
1356
- # @driver.find_element(:xpath ,'//*[@id="root"]/div/div[1]/div/div[3]/div[3]/div/div/div/div[3]/div/div/ul/li[1]/span/label').click
1357
- # elsif option['공개'] == '3'
1358
- # @driver.find_element(:xpath, '//*[@id="root"]/div/div[1]/div/div[3]/div[3]/div/div/div/div[3]/div/div/ul/li[3]/span/label').click
1359
- # elsif option['공개'] == '0'
1360
- # @driver.find_element(:xpath, '//*[@id="root"]/div/div[1]/div/div[3]/div[3]/div/div/div/div[3]/div/div/ul/li[4]/span/label').click
1361
- # else
1362
- # @driver.find_element(:xpath, '//*[@id="root"]/div/div[1]/div/div[3]/div[3]/div/div/div/div[3]/div/div/ul/li[2]/span/label').click
1363
- # end
1358
+
1359
+ if option['전체공개'] == 'true'
1360
+ puts '전체공개'
1361
+ begin
1362
+ @driver.find_element(:xpath, '//*[@class="btn_open_set"]').click
1363
+ sleep(2)
1364
+ @driver.find_element(:xpath, '//*[@for="all"]').click
1365
+ rescue
1366
+ end
1367
+ sleep(1)
1368
+ end
1369
+
1370
+ if option['멤버공개'] == 'true'
1371
+ puts '멤버공개'
1372
+ begin
1373
+ @driver.find_element(:xpath, '//*[@class="btn_open_set"]').click
1374
+ sleep(2)
1375
+ @driver.find_element(:xpath, '//*[@for="member"]').click
1376
+ rescue
1377
+ end
1378
+ sleep(1)
1379
+ end
1380
+
1364
1381
  if option['댓글허용'] == 'true'
1365
1382
  puts '댓글허용'
1366
-
1367
- begin
1368
- @driver.find_element(:xpath, '/html/body/div[1]/div/div/section/div/div[2]/div[2]/div[3]/ul/li[1]/div/label').click
1369
- sleep(1)
1370
- rescue
1371
-
1383
+ begin
1384
+ @driver.find_element(:xpath, '//*[@for="coment"]').click
1385
+ rescue
1386
+ end
1387
+ sleep(1)
1372
1388
  end
1373
- end
1374
1389
 
1375
-
1390
+
1376
1391
  if option['블로그,카페 공유허용'] == 'true'
1377
1392
  puts '블로그,카페 공유허용'
1378
1393
  begin
1379
- @driver.find_element(:xpath, '/html/body/div[1]/div/div/section/div/div[2]/div[2]/div[3]/ul/li[2]/div[1]/label').click
1380
- rescue
1381
-
1394
+ @driver.find_element(:xpath, '//*[@for="blog_sharing"]').click
1395
+ rescue
1396
+ end
1397
+ sleep(1)
1382
1398
  end
1383
- end
1384
1399
 
1385
1400
 
1386
-
1401
+
1387
1402
  if option['외부공유허용'] == 'true'
1388
1403
  puts '외부공유허용'
1389
1404
  begin
1390
- @driver.find_element(:xpath, '/html/body/div[1]/div/div/section/div/div[2]/div[2]/div[3]/ul/li[3]/div[1]/label').click
1391
- sleep(1)
1392
- rescue
1393
-
1405
+ @driver.find_element(:xpath, '//*[@for="external_sharing"]').click
1406
+ rescue
1407
+ end
1408
+ sleep(1)
1394
1409
  end
1395
- end
1396
1410
 
1397
-
1411
+
1398
1412
 
1399
1413
  if option['복사,저장 허용'] == 'true'
1400
1414
  puts '복사,저장 허용'
1401
1415
  begin
1402
- @driver.find_element(:xpath, '/html/body/div[1]/div/div/section/div/div[2]/div[2]/div[3]/ul/li[4]/div[1]/label').click
1403
- sleep(1)
1416
+ @driver.find_element(:xpath, '//*[@for="copy"]').click
1404
1417
  rescue
1405
-
1406
1418
  end
1419
+ sleep(1)
1407
1420
  end
1408
1421
 
1409
-
1422
+
1410
1423
  if option['자동출처 사용'] == 'true'
1411
- puts '자동출처 사용'
1424
+ puts '자동출처 사용'
1412
1425
  begin
1413
- @driver.find_element(:xpath, '/html/body/div[1]/div/div/section/div/div[2]/div[2]/div[3]/ul/li[5]/div[1]/label').click
1414
- sleep(1)
1426
+ @driver.find_element(:xpath, '//*[@for="automatic_source"]').click
1415
1427
  rescue
1416
-
1417
1428
  end
1429
+ sleep(1)
1418
1430
  end
1419
-
1431
+
1432
+
1420
1433
 
1421
1434
  if option['CCL 사용'] == 'true'
1422
1435
  puts 'CCL 사용'
1423
1436
  begin
1424
- @driver.find_element(:xpath, '/html/body/div[1]/div/div/section/div/div[2]/div[2]/div[3]/ul/li[6]/div[1]/label').click
1425
- sleep(1)
1437
+ @driver.find_element(:xpath, '//*[@for="ccl"]').click
1426
1438
  rescue
1427
-
1428
1439
  end
1440
+ sleep(1)
1429
1441
  end
1430
-
1442
+
1431
1443
  # puts data['documentModel'] = data['documentModel'].to_json
1432
1444
 
1433
1445
  sleep(dd_time.to_i)
1434
- @driver.find_element(:xpath, '/html/body/div[1]/div/div/section/div/div[1]/div/a').click
1446
+ @driver.find_element(:xpath, '//*[@class="BaseButton BaseButton--skinGreen size_default"]').click
1435
1447
 
1436
1448
  sleep(7)
1437
1449
 
@@ -2131,7 +2143,7 @@ class Wordpress
2131
2143
  @data['table'] << []
2132
2144
  @data['table'].pop
2133
2145
  #포스팅 get 데이터 가저오기#############################
2134
- proxy = table[3].to_s
2146
+ proxy = table[6].to_s
2135
2147
  user_id = table[1].to_s
2136
2148
  user_pw = table[2].to_s
2137
2149
  naver = Naver.new
@@ -2874,13 +2886,15 @@ class Wordpress
2874
2886
 
2875
2887
 
2876
2888
  if @data['포스트설정']['전체공개'].checked?
2877
- option['공개'] = '2'
2878
- # elsif @data['포스트설정']['서로이웃공개'].checked?
2879
- # option['공개'] = '3'
2880
- # elsif @data['포스트설정']['비공개'].checked?
2881
- # option['공개'] = '0'
2889
+ option['전체공개'] = 'true'
2890
+ else
2891
+ option['전체공개'] = 'false'
2892
+ end
2893
+
2894
+ if @data['포스트설정']['멤버공개'].checked?
2895
+ option['멤버공개'] = 'true'
2882
2896
  else
2883
- option['공개'] = '1'
2897
+ option['멤버공개'] = 'false'
2884
2898
  end
2885
2899
 
2886
2900
  if @data['포스트설정']['댓글허용'].checked?
@@ -4831,7 +4845,7 @@ class Wordpress
4831
4845
  end
4832
4846
  }
4833
4847
  }
4834
- @data['포스트설정']['멤버공개'] = checkbox('맴버공개'){
4848
+ @data['포스트설정']['멤버공개'] = checkbox('멤버공개'){
4835
4849
  top 10
4836
4850
  left 1
4837
4851
  on_toggled{
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cafe_basics_duo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.21
4
+ version: 0.0.27
5
5
  platform: ruby
6
6
  authors:
7
7
  - zon
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-01-20 00:00:00.000000000 Z
11
+ date: 2025-01-24 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: File to Clipboard gem
14
14
  email: mymin26@naver.com