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

+43
View File
@@ -0,0 +1,43 @@
import sys
def main():
with open('trials/index.html', 'r', encoding='utf-8-sig') as f:
content = f.read()
target = """ <tr>
<td><strong>幻白虎討滅戦(現行パッチ開催)</strong></td>
<td>Lv100 (ILシンク)</td>
<td>幻討滅戦</td>
<td>極白虎を最新Lv100で再現。ソーチョーの幻想盤、高額マウント・ミニオン。</td>
<td>準備中</td>
</tr>"""
replacement = """ <tr>
<td><strong>幻白虎討滅戦(現行パッチ開催)</strong></td>
<td>Lv100 (ILシンク)</td>
<td>幻討滅戦</td>
<td>極白虎を最新Lv100で再現。ソーチョーの幻想盤、高額マウント・ミニオン。</td>
<td><a href="faux_byakko.html">攻略を見る ➜</a></td>
</tr>"""
if target not in content:
print("エラー: ターゲット文字列が見つかりません")
sys.exit(1)
content = content.replace(target, replacement)
lines = [line.rstrip() for line in content.splitlines()]
content_clean = '\r\n'.join(lines) + '\r\n'
with open('trials/index.html', 'wb') as f:
f.write(b'\xef\xbb\xbf' + content_clean.encode('utf-8'))
with open('trials/faux_byakko.html', 'r', encoding='utf-8-sig') as f:
faux = f.read()
faux_lines = [line.rstrip() for line in faux.splitlines()]
faux_clean = '\r\n'.join(faux_lines) + '\r\n'
with open('trials/faux_byakko.html', 'wb') as f:
f.write(b'\xef\xbb\xbf' + faux_clean.encode('utf-8'))
print("幻白虎討滅戦のリンク更新および正規化が完了しました。")
if __name__ == '__main__':
main()