feat: エターナル・クイーン討滅戦 完全攻略ページの作成およびリンク追加

This commit is contained in:
armonica committed 2026-10-29 11:40:00 +09:00
1 parent 21f9742e87
commit 6491dfeb60
5 files changed
+218 -14

No files matched your search

+25 -13
View File
@@ -22,39 +22,51 @@ def clean_and_save(path, content):
with open(path, 'wb') as f:
f.write(b'\xef\xbb\xbf' + text.encode('utf-8'))
def update_zorool_ja():
def update_eternal_queen():
# 1. trials/index.html
path_idx = 'trials/index.html'
with open(path_idx, 'rb') as f:
c = f.read().decode('utf-8', errors='ignore')
if 'href="zorool_ja.html"' not in c:
if 'href="eternal_queen.html"' not in c:
c = c.replace('\r\n', '\n')
c = re.sub(r'(ゾラージャ討滅戦</strong>.*?<td>)準備中(</td>)', r'\1<a href="zorool_ja.html">攻略を見る ➜</a>\2', c, flags=re.DOTALL)
target = '<td><a href="zorool_ja.html">攻略を見る ➜</a></td>\n </tr>'
new_row = '''<td><a href="zorool_ja.html">攻略を見る ➜</a></td>
</tr>
<tr>
<td><strong>エターナル・クイーン討滅戦</strong></td>
<td>Lv100 (8人)</td>
<td><strong>【黄金ラスボス】</strong> 空間次元切断、仮想浮遊、ターニング・ウィンド、ドーン・エイジ。</td>
<td><a href="eternal_queen.html">攻略を見る ➜</a></td>
</tr>'''
if target in c:
c = c.replace(target, new_row)
else:
c = re.sub(r'(<td><a href="zorool_ja\.html">.*?</td>\s*</tr>)', r'\1\n <tr>\n <td><strong>エターナル・クイーン討滅戦</strong></td>\n <td>Lv100 (8人)</td>\n <td><strong>【黄金ラスボス】</strong> 空間次元切断、仮想浮遊、ターニング・ウィンド、ドーン・エイジ。</td>\n <td><a href="eternal_queen.html">攻略を見る ➜</a></td>\n </tr>', c)
clean_and_save(path_idx, c)
print("Updated zorool_ja in trials/index.html")
print("Updated eternal_queen in trials/index.html")
# 2. common/sidebar.html
path_sb = 'common/sidebar.html'
with open(path_sb, 'rb') as f:
c = f.read().decode('utf-8', errors='ignore')
new_sb = '<li><a href="../trials/zorool_ja.html">ゾラージャ討滅戦 (Lv99)</a></li>'
new_sb = '<li><a href="../trials/eternal_queen.html">エターナル・クイーン (Lv100)</a></li>'
if new_sb not in c:
c = c.replace('\r\n', '\n')
c = re.sub(r'(<li><a href="\.\./trials/valigarmanda\.html">.*?</li>)', r'\1\n ' + new_sb, c)
c = re.sub(r'(<li><a href="\.\./trials/zorool_ja\.html">.*?</li>)', r'\1\n ' + new_sb, c)
clean_and_save(path_sb, c)
print("Added zorool_ja to common/sidebar.html")
print("Added eternal_queen to common/sidebar.html")
# 3. common/js/wiki_common.js
path_js = 'common/js/wiki_common.js'
with open(path_js, 'rb') as f:
c = f.read().decode('utf-8', errors='ignore')
new_js = "{ text: 'ゾラージャ討滅戦 (Lv99)', path: 'trials/zorool_ja.html' }"
if 'zorool_ja.html' not in c:
new_js = "{ text: 'エターナル・クイーン (Lv100)', path: 'trials/eternal_queen.html' }"
if 'eternal_queen.html' not in c:
c = c.replace('\r\n', '\n')
c = re.sub(r"(\{ text: 'ヴァリガルマンダ討滅戦 \(Lv93\)', path: 'trials/valigarmanda\.html' \})", r"\1,\n " + new_js, c)
c = re.sub(r"(\{ text: 'ゾラージャ討滅戦 \(Lv99\)', path: 'trials/zorool_ja\.html' \})", r"\1,\n " + new_js, c)
clean_and_save(path_js, c)
print("Added zorool_ja to common/js/wiki_common.js")
print("Added eternal_queen to common/js/wiki_common.js")
if __name__ == '__main__':
clean_and_save('trials/zorool_ja.html', open('trials/zorool_ja.html', 'r', encoding='utf-8', errors='ignore').read())
update_zorool_ja()
clean_and_save('trials/eternal_queen.html', open('trials/eternal_queen.html', 'r', encoding='utf-8', errors='ignore').read())
update_eternal_queen()