posting_duo 3.111.021 → 3.111.025

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/posting_duo.rb +63 -13
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b74590d443d2941fa0cbb91c083f57ed321a6a03e54e7469f6cf7b9094d70593
4
- data.tar.gz: 34cfd296c93c4b7e230ddecfc9f2c6acee29fa7c6c4e6e93770436a2dae0e7f5
3
+ metadata.gz: b8952fc578e8006291440c2c1bdcb9186f6350f59296de539115eb45b1c8f263
4
+ data.tar.gz: 4c51001daf700a852c9602dae4d33e59a873be989785739cbe109820d1fe5c1d
5
5
  SHA512:
6
- metadata.gz: c1f551c8cbd9ed9281b86f667124425d4cfadcb627be043d2af21aa9d718de12990d5807846aab1b24d3d82fbf9e5a87027169880a30930da0271769c7ed6a5f
7
- data.tar.gz: 601f03049a877e0d42b32afa8cdf2309a81106b8b6c4f21973aa286726c96c9aba8829e2fb066b8d644f467e2dd1f7675327d11445e4403cb938c85c9f0365ae
6
+ metadata.gz: 5ba15a1840778d911909e35105f63e261fa994dba5104d836cec3e7e43a441429a95fad49e7a52ec9fe9359a052ae0669926457946adc39e7476f159d7c84fad
7
+ data.tar.gz: 4dd8d8c4580e864687a26619bfe87e70d6e29832cf2cf99892843d7b68d5dabb23af752ed61e40e18f9e635e6be61213626fb77d41f56356400beb06937996de
data/lib/posting_duo.rb CHANGED
@@ -3678,6 +3678,27 @@ end
3678
3678
  # 알림이 나타나지 않으면 예외 처리하고 넘어감
3679
3679
  end
3680
3680
 
3681
+ ##<─────────────────────────────────────────────────────────────────────가입 로그 출력
3682
+
3683
+
3684
+ begin
3685
+ signup_url = @driver.current_url
3686
+ now = Time.now
3687
+
3688
+ # 로그 폴더 생성
3689
+ FileUtils.mkdir_p('./log') unless Dir.exist?('./log')
3690
+
3691
+ # 오늘 날짜 기준 로그 파일 경로
3692
+ log_file = "./log/#{now.strftime('%Y%m%d')}_signup_log.txt"
3693
+
3694
+ # 로그 줄 내용
3695
+ log_line = "[#{now.strftime('%Y년%m월%d일 %H시%M분%S초')}] #{user_id}, #{user_pw}, #{signup_url}\n"
3696
+
3697
+ # 파일에 추가 (없으면 생성)
3698
+ File.open(log_file, 'a') { |f| f.write(log_line) }
3699
+ rescue
3700
+ end
3701
+
3681
3702
 
3682
3703
  end
3683
3704
  rescue => e
@@ -5010,7 +5031,7 @@ login_url = option['login_url'].to_s
5010
5031
  sleep(3)
5011
5032
  rescue
5012
5033
  begin
5013
- @driver.find_element(:xpath, '//*[@class="btn_login"]').click
5034
+ @driver.find_element(:xpath, '//button[@type="submit" and @class="join_btn"]').click
5014
5035
  puts '-[√] 로그인 버튼 코드 5 타겟.......'.cyan
5015
5036
  sleep(3)
5016
5037
  rescue
@@ -5089,9 +5110,15 @@ login_url = option['login_url'].to_s
5089
5110
  puts '-[√] 로그인 버튼 코드 20 타겟.......'.cyan
5090
5111
  sleep(3)
5091
5112
  rescue
5092
-
5093
- @driver.action.key_down(:enter).key_up(:enter).perform #엔터
5094
- sleep(3)
5113
+ begin
5114
+ @driver.find_element(:xpath, '//*[@class="btn_login"]').click
5115
+ puts '-[√] 로그인 버튼 코드 21 타겟.......'.cyan
5116
+ sleep(3)
5117
+ rescue
5118
+
5119
+ @driver.action.key_down(:enter).key_up(:enter).perform #엔터
5120
+ sleep(3)
5121
+ end
5095
5122
  end
5096
5123
  end
5097
5124
  end
@@ -7752,6 +7779,7 @@ sleep(1)
7752
7779
  @driver.find_element(:xpath, '//*[@for="wr_subject"]').send_keys(title)
7753
7780
  puts '-[√] 제목 code 18.......'.yellow
7754
7781
 
7782
+
7755
7783
  rescue
7756
7784
  ########################################################2차@#######################################
7757
7785
  begin
@@ -7979,14 +8007,21 @@ rescue
7979
8007
  @driver.find_element(:xpath, '//*[@id="csTitle"]').send_keys(title)
7980
8008
  sleep(1)
7981
8009
  puts '-[√] 제목 code 49.......'.yellow
7982
- rescue => e
7983
- puts '-[√] 제목 입력 항목 코드 탐색 실패!!.......'.red
7984
- puts '-[√] 다음 작업 준비 중으로 1~60 정도 기다려주세요.......'.red
8010
+ rescue
8011
+ begin
8012
+ target_element = @driver.find_element(:xpath, '//*[@id="contents" and @name="contents"]') # 제목이 없어 내용필드로 선택
8013
+ @driver.find_element(:xpath, '//*[@id="contents" and @name="contents"]').send_keys(title)
8014
+ sleep(1)
8015
+ puts '-[√] 제목 code 50.......'.yellow
8016
+ rescue => e
8017
+ puts '-[√] 제목 입력 항목 코드 탐색 실패!!.......'.red
8018
+ puts '-[√] 다음 작업 준비 중으로 1~60 초 정도 기다려주세요.......'.red
7985
8019
 
7986
- @driver.quit
7987
- sleep(1)
7988
- return 0
7989
- sleep(1)
8020
+ @driver.quit
8021
+ sleep(1)
8022
+ return 0
8023
+ sleep(1)
8024
+ end
7990
8025
  end
7991
8026
  end
7992
8027
  end
@@ -8793,12 +8828,16 @@ begin
8793
8828
  puts '내용 항목 코드 타겟 54.......'.red
8794
8829
  rescue
8795
8830
  begin
8831
+ @driver.find_element(:xpath, '//*[@id="contents" and @name="contents"]').click
8832
+ puts '내용 항목 코드 타겟 55.......'.red
8833
+ rescue
8834
+ begin
8796
8835
  # 1. 첫 번째 iframe (id="namoIframe0") 진입
8797
8836
  @driver.switch_to.frame(@driver.find_element(:id, 'namoIframe0'))
8798
8837
  # 2. 두 번째 iframe (id="NamoSE_Ifr__namo0") 진입
8799
8838
  @driver.switch_to.frame(@driver.find_element(:id, 'NamoSE_Ifr__namo0'))
8800
8839
  @driver.find_element(id: 'NamoSE_editorshtml_namo0').click
8801
- puts '내용 항목 코드 타겟 55.......'.red
8840
+ puts '내용 항목 코드 타겟 56.......'.red
8802
8841
  @driver.switch_to.default_content
8803
8842
  rescue
8804
8843
  end
@@ -8856,7 +8895,7 @@ end
8856
8895
  end
8857
8896
  end
8858
8897
  end
8859
-
8898
+ end
8860
8899
 
8861
8900
  end
8862
8901
  sleep(1)
@@ -12504,6 +12543,16 @@ ss_button = @driver.find_element(xpath: '//button[@type="submit" and contains(@c
12504
12543
  puts '-[√] 등록을 55번 코드로 시도하였습니다.......'.magenta
12505
12544
  sleep(1)
12506
12545
 
12546
+ rescue
12547
+ begin
12548
+ ss_button = @driver.find_element(xpath: '//button[@type="submit" and @class="btn btn-danger"]')
12549
+ @driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", ss_button)
12550
+ sleep(1)
12551
+
12552
+ ss_button = @driver.find_element(xpath: '//button[@type="submit" and @class="btn btn-danger"]').click
12553
+ puts '-[√] 등록을 56번 코드로 시도하였습니다.......'.magenta
12554
+ sleep(1)
12555
+
12507
12556
 
12508
12557
  rescue
12509
12558
  ########─────────────────────────────▼▼▼▼▼▼▼ 등록버튼 2차 시도 ▼▼▼▼▼▼▼──────────────────────────────#######
@@ -12719,6 +12768,7 @@ end
12719
12768
  end
12720
12769
  end
12721
12770
  end
12771
+ end
12722
12772
  ########─────────────────────────────▲▲▲▲▲▲▲ 등록버튼 2차 시도 ▲▲▲▲▲▲▲──────────────────────────────#######
12723
12773
  end
12724
12774
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: posting_duo
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.111.021
4
+ version: 3.111.025
5
5
  platform: ruby
6
6
  authors:
7
7
  - zon
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-07-07 00:00:00.000000000 Z
10
+ date: 2025-07-11 00:00:00.000000000 Z
11
11
  dependencies: []
12
12
  description: File to Clipboard gem
13
13
  email: mymin26@naver.com