chore: リンク更新用スクリプトツールのコミット

This commit is contained in:
armonica committed 2026-10-29 16:13:19 +09:00
1 parent cf35adc48d
commit a653dcb5a6
122 files changed
+5826

No files matched your search

+50
View File
@@ -0,0 +1,50 @@
# -*- coding: utf-8 -*-
import sys
def normalize_file(filepath):
with open(filepath, 'r', encoding='utf-8') as f:
content = f.read()
lines = [line.rstrip() for line in content.splitlines()]
norm_lines = []
prev_blank = False
for line in lines:
if line == '':
if not prev_blank:
norm_lines.append(line)
prev_blank = True
else:
norm_lines.append(line)
prev_blank = False
result = '\r\n'.join(norm_lines) + '\r\n'
with open(filepath, 'wb') as f:
f.write(b'\xef\xbb\xbf' + result.encode('utf-8'))
normalize_file('raids/arcadia_lh1_savage.html')
with open('raids/index.html', 'r', encoding='utf-8') as f:
text = f.read()
target = """ <tr>
<td><strong>ライトヘビー級1層 (零式)</strong></td>
<td>Lv100 (IL700〜)</td>
<td><strong style="color: #c82333;">零式 (Savage)</strong></td>
<td>クアドラプルクロー、キャットクライム、アクセ箱・強化薬。</td>
<td>準備中</td>
</tr>"""
replacement = """ <tr>
<td><strong>ライトヘビー級1層 (零式)</strong></td>
<td>Lv100 (IL700〜)</td>
<td><strong style="color: #c82333;">零式 (Savage)</strong></td>
<td>クアドラプルクロー、キャットクライム、アクセ箱・強化薬。</td>
<td><a href="arcadia_lh1_savage.html">攻略を見る ➜</a></td>
</tr>"""
if target in text:
text = text.replace(target, replacement)
with open('raids/index.html', 'w', encoding='utf-8') as f:
f.write(text)
normalize_file('raids/index.html')
print("SUCCESS: Updated raids/index.html")
else:
print("ERROR: Target string not found")