feat: 至天の座 アルカディア: ライトヘビー級3層 完全攻略ページの作成およびリンク追加
This commit is contained in:
1 parent
ea90e9a8e0
commit
b40fb4cf50
5 files changed
+209
-15
No files matched your search
+15
-15
@@ -22,26 +22,26 @@ def clean_and_save(path, content):
|
||||
with open(path, 'wb') as f:
|
||||
f.write(b'\xef\xbb\xbf' + text.encode('utf-8'))
|
||||
|
||||
def update_raid_lh2():
|
||||
def update_raid_lh3():
|
||||
# 1. raids/index.html
|
||||
path_idx = 'raids/index.html'
|
||||
with open(path_idx, 'rb') as f:
|
||||
c = f.read().decode('utf-8', errors='ignore')
|
||||
if 'arcadia_lh2.html' not in c:
|
||||
if 'arcadia_lh3.html' not in c:
|
||||
c = c.replace('\r\n', '\n')
|
||||
target = '<td><a href="arcadia_lh1.html">攻略を見る ➜</a></td>\n </tr>'
|
||||
new_row = '''<td><a href="arcadia_lh1.html">攻略を見る ➜</a></td>
|
||||
target = '<td><a href="arcadia_lh2.html">攻略を見る ➜</a></td>\n </tr>'
|
||||
new_row = '''<td><a href="arcadia_lh2.html">攻略を見る ➜</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>至天の座 アルカディア:<br>ライトヘビー級2層</strong></td>
|
||||
<td><strong>至天の座 アルカディア:<br>ライトヘビー級3層</strong></td>
|
||||
<td>Lv100 (パッチ7.x最新)</td>
|
||||
<td><strong>【最新ノーマルレイド】</strong> ボス「ハニー・B・ラブリー」。ハートスタック管理、塔踏み、アラモード。</td>
|
||||
<td><a href="arcadia_lh2.html">攻略を見る ➜</a></td>
|
||||
<td><strong>【最新ノーマルレイド】</strong> ボス「ブルートボンバー」。ブルートラリアット、ボンバリアンボム、スマッシュインパクト。</td>
|
||||
<td><a href="arcadia_lh3.html">攻略を見る ➜</a></td>
|
||||
</tr>'''
|
||||
if target in c:
|
||||
c = c.replace(target, new_row)
|
||||
else:
|
||||
c = re.sub(r'(<td><a href="arcadia_lh1\.html">.*?</td>\s*</tr>)', r'\1\n <tr>\n <td><strong>至天の座 アルカディア:<br>ライトヘビー級2層</strong></td>\n <td>Lv100 (パッチ7.x最新)</td>\n <td><strong>【最新ノーマルレイド】</strong> ボス「ハニー・B・ラブリー」。ハートスタック管理、塔踏み、アラモード。</td>\n <td><a href="arcadia_lh2.html">攻略を見る ➜</a></td>\n </tr>', c)
|
||||
c = re.sub(r'(<td><a href="arcadia_lh2\.html">.*?</td>\s*</tr>)', r'\1\n <tr>\n <td><strong>至天の座 アルカディア:<br>ライトヘビー級3層</strong></td>\n <td>Lv100 (パッチ7.x最新)</td>\n <td><strong>【最新ノーマルレイド】</strong> ボス「ブルートボンバー」。ブルートラリアット、ボンバリアンボム、スマッシュインパクト。</td>\n <td><a href="arcadia_lh3.html">攻略を見る ➜</a></td>\n </tr>', c)
|
||||
clean_and_save(path_idx, c)
|
||||
print("Updated raids/index.html")
|
||||
|
||||
@@ -49,10 +49,10 @@ def update_raid_lh2():
|
||||
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="../raids/arcadia_lh2.html">アルカディア LH2層 (Lv100)</a></li>'
|
||||
new_sb = '<li><a href="../raids/arcadia_lh3.html">アルカディア LH3層 (Lv100)</a></li>'
|
||||
if new_sb not in c:
|
||||
c = c.replace('\r\n', '\n')
|
||||
c = re.sub(r'(<li><a href="\.\./raids/arcadia_lh1\.html">.*?</li>)', r'\1\n ' + new_sb, c)
|
||||
c = re.sub(r'(<li><a href="\.\./raids/arcadia_lh2\.html">.*?</li>)', r'\1\n ' + new_sb, c)
|
||||
clean_and_save(path_sb, c)
|
||||
print("Updated common/sidebar.html")
|
||||
|
||||
@@ -60,13 +60,13 @@ def update_raid_lh2():
|
||||
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: 'アルカディア LH2層 (Lv100)', path: 'raids/arcadia_lh2.html' }"
|
||||
if 'arcadia_lh2.html' not in c:
|
||||
new_js = "{ text: 'アルカディア LH3層 (Lv100)', path: 'raids/arcadia_lh3.html' }"
|
||||
if 'arcadia_lh3.html' not in c:
|
||||
c = c.replace('\r\n', '\n')
|
||||
c = re.sub(r"(\{ text: 'アルカディア LH1層 \(Lv100\)', path: 'raids/arcadia_lh1\.html' \})", r"\1,\n " + new_js, c)
|
||||
c = re.sub(r"(\{ text: 'アルカディア LH2層 \(Lv100\)', path: 'raids/arcadia_lh2\.html' \})", r"\1,\n " + new_js, c)
|
||||
clean_and_save(path_js, c)
|
||||
print("Updated common/js/wiki_common.js")
|
||||
|
||||
if __name__ == '__main__':
|
||||
clean_and_save('raids/arcadia_lh2.html', open('raids/arcadia_lh2.html', 'r', encoding='utf-8', errors='ignore').read())
|
||||
update_raid_lh2()
|
||||
clean_and_save('raids/arcadia_lh3.html', open('raids/arcadia_lh3.html', 'r', encoding='utf-8', errors='ignore').read())
|
||||
update_raid_lh3()
|
||||
Reference in new issue
Block a user