cafe_buy_duo 0.0.21 → 0.0.27

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/cafe_buy_duo.rb +77 -65
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a08dd941b463ea6a2da44c03146dd90ac71e0c439781ae8181c83d432cb4e62d
4
- data.tar.gz: 0d7a4327ef647325b75dde558eec5c67d29f0c07c6f5473bf473431086d5be72
3
+ metadata.gz: f1aee6b511f302ff5547186137dd106fcc05566ba1d8de255d726c2ab2cdf6cc
4
+ data.tar.gz: 28af9667aa49110769b88b1f2b0d7bd34d75d09183e55c13ba74ec74bd7985e6
5
5
  SHA512:
6
- metadata.gz: 290fb53426a540f56ef48937d5923c2a87236c1c4e1eb81c203b8520415eac8323941f8b9aa182ed0d1fa06b8cf95c3ab511e24fe7bf47bff24644d816f04ca3
7
- data.tar.gz: fca0e4c96bb6902c9c4e48100f668b531ceb30c12e3514bf0a8cefe9d6c8941e6009210cbbf305fe57fe3d7a5fe9da6b4fd65f6003cf47e68eacfacad7ec8d00
6
+ metadata.gz: ce58f1bb04c689261d415272711eb901644656e09ee67169c1ea0e8c98d4392aac226ce9daeecb9b7b345530fc660817d96ebeca93d3032acfa317280c9e2eb7
7
+ data.tar.gz: 8acb442de9c7b7304f18a6a5db61f7eed6d129667d33e285e9c38a810dfa346054657ce5b63cd9bee63030e309759a64e78f4dcce7d86568e3ee8d5519a03695
data/lib/cafe_buy_duo.rb CHANGED
@@ -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
 
@@ -1564,11 +1567,11 @@ end
1564
1567
  end
1565
1568
  end
1566
1569
  end
1567
- sleep(1)
1570
+ sleep(0.5)
1568
1571
  @driver.action.key_down(:end).key_up(:end).perform
1569
- sleep(1)
1572
+ sleep(0.5)
1570
1573
  @driver.action.key_down(:enter).key_up(:enter).perform
1571
- sleep(1)
1574
+ sleep(0.5)
1572
1575
  # if check_image == 0
1573
1576
  # if value_data['nodes'].length == 0
1574
1577
  # value_data['nodes'][0] = {
@@ -1669,89 +1672,95 @@ end
1669
1672
  @driver.find_element(:xpath, '//*[@placeholder="태그를 입력해주세요 (최대 10개)"]').send_keys(tag_mm2.join("\n")+"\n")
1670
1673
 
1671
1674
  sleep(1)
1672
- # 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=="}'
1673
- # if option['공개'] == '2'
1674
- # @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
1675
- # elsif option['공개'] == '3'
1676
- # @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
1677
- # elsif option['공개'] == '0'
1678
- # @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
1679
- # else
1680
- # @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
1681
- # end
1675
+
1676
+ if option['전체공개'] == 'true'
1677
+ puts '전체공개'
1678
+ begin
1679
+ @driver.find_element(:xpath, '//*[@class="btn_open_set"]').click
1680
+ sleep(2)
1681
+ @driver.find_element(:xpath, '//*[@for="all"]').click
1682
+ rescue
1683
+ end
1684
+ sleep(1)
1685
+ end
1686
+
1687
+ if option['멤버공개'] == 'true'
1688
+ puts '멤버공개'
1689
+ begin
1690
+ @driver.find_element(:xpath, '//*[@class="btn_open_set"]').click
1691
+ sleep(2)
1692
+ @driver.find_element(:xpath, '//*[@for="member"]').click
1693
+ rescue
1694
+ end
1695
+ sleep(1)
1696
+ end
1697
+
1682
1698
  if option['댓글허용'] == 'true'
1683
1699
  puts '댓글허용'
1684
- begin
1685
- @driver.find_element(:xpath, '/html/body/div[1]/div/div/section/div/div[2]/div[2]/div[3]/ul/li[1]/div/label').click
1686
- sleep(1)
1687
-
1688
- rescue
1689
-
1700
+ begin
1701
+ @driver.find_element(:xpath, '//*[@for="coment"]').click
1702
+ rescue
1703
+ end
1704
+ sleep(1)
1690
1705
  end
1691
- end
1692
1706
 
1693
-
1707
+
1694
1708
  if option['블로그,카페 공유허용'] == 'true'
1695
1709
  puts '블로그,카페 공유허용'
1696
1710
  begin
1697
- @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
1698
- sleep(1)
1699
- rescue
1700
-
1711
+ @driver.find_element(:xpath, '//*[@for="blog_sharing"]').click
1712
+ rescue
1713
+ end
1714
+ sleep(1)
1701
1715
  end
1702
- end
1703
1716
 
1704
1717
 
1705
-
1718
+
1706
1719
  if option['외부공유허용'] == 'true'
1707
1720
  puts '외부공유허용'
1708
1721
  begin
1709
- @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
1710
- sleep(1)
1711
- rescue
1712
-
1722
+ @driver.find_element(:xpath, '//*[@for="external_sharing"]').click
1723
+ rescue
1724
+ end
1725
+ sleep(1)
1713
1726
  end
1714
- end
1715
1727
 
1716
- sleep(1)
1728
+
1717
1729
 
1718
1730
  if option['복사,저장 허용'] == 'true'
1719
1731
  puts '복사,저장 허용'
1720
1732
  begin
1721
- @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
1733
+ @driver.find_element(:xpath, '//*[@for="copy"]').click
1734
+ rescue
1735
+ end
1722
1736
  sleep(1)
1723
- rescue
1724
-
1725
1737
  end
1726
- end
1727
1738
 
1728
-
1739
+
1729
1740
  if option['자동출처 사용'] == 'true'
1730
- puts '자동출처 사용'
1731
- begin
1732
- @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
1733
- sleep(1)
1734
- rescue
1735
-
1736
- end
1737
- end
1741
+ puts '자동출처 사용'
1742
+ begin
1743
+ @driver.find_element(:xpath, '//*[@for="automatic_source"]').click
1744
+ rescue
1745
+ end
1746
+ sleep(1)
1747
+ end
1738
1748
 
1739
-
1749
+
1740
1750
 
1741
1751
  if option['CCL 사용'] == 'true'
1742
1752
  puts 'CCL 사용'
1743
1753
  begin
1744
- @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
1754
+ @driver.find_element(:xpath, '//*[@for="ccl"]').click
1755
+ rescue
1756
+ end
1745
1757
  sleep(1)
1746
- rescue
1747
-
1748
1758
  end
1749
- end
1750
-
1759
+
1751
1760
  # puts data['documentModel'] = data['documentModel'].to_json
1752
- sleep(2)
1761
+
1753
1762
  sleep(dd_time.to_i)
1754
- @driver.find_element(:xpath, '/html/body/div[1]/div/div/section/div/div[1]/div/a').click
1763
+ @driver.find_element(:xpath, '//*[@class="BaseButton BaseButton--skinGreen size_default"]').click
1755
1764
 
1756
1765
  sleep(7)
1757
1766
 
@@ -2470,7 +2479,7 @@ class Wordpress
2470
2479
  @data['table'] << []
2471
2480
  @data['table'].pop
2472
2481
  #포스팅 get 데이터 가저오기#############################
2473
- proxy = table[3].to_s
2482
+ proxy = table[6].to_s
2474
2483
  user_id = table[1].to_s
2475
2484
  user_pw = table[2].to_s
2476
2485
  naver = Naver.new
@@ -3212,14 +3221,17 @@ class Wordpress
3212
3221
  option['배달'] = [@data['포스트설정']['직거래'].checked?, @data['포스트설정']['택배 거래'].checked?, @data['포스트설정']['온라인전송'].checked?]
3213
3222
  option['직 거래 카테고리'] = product_category1
3214
3223
  option['결제'] = payment
3224
+
3215
3225
  if @data['포스트설정']['전체공개'].checked?
3216
- option['공개'] = '2'
3217
- # elsif @data['포스트설정']['서로이웃공개'].checked?
3218
- # option['공개'] = '3'
3219
- # elsif @data['포스트설정']['비공개'].checked?
3220
- # option['공개'] = '0'
3226
+ option['전체공개'] = 'true'
3227
+ else
3228
+ option['전체공개'] = 'false'
3229
+ end
3230
+
3231
+ if @data['포스트설정']['멤버공개'].checked?
3232
+ option['멤버공개'] = 'true'
3221
3233
  else
3222
- option['공개'] = '1'
3234
+ option['멤버공개'] = 'false'
3223
3235
  end
3224
3236
 
3225
3237
  if @data['포스트설정']['댓글허용'].checked?
@@ -5168,7 +5180,7 @@ class Wordpress
5168
5180
  end
5169
5181
  }
5170
5182
  }
5171
- @data['포스트설정']['멤버공개'] = checkbox('맴버공개'){
5183
+ @data['포스트설정']['멤버공개'] = checkbox('멤버공개'){
5172
5184
  top 10
5173
5185
  left 1
5174
5186
  on_toggled{
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cafe_buy_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