From 76ff525ae48b550a799599ac1a9f809abd2d8104 Mon Sep 17 00:00:00 2001 From: tsxc Date: Tue, 28 Jan 2025 11:31:49 +0800 Subject: [PATCH] =?UTF-8?q?=E9=BB=98=E8=AE=A4=E9=9A=90=E8=97=8F+=E6=96=87?= =?UTF-8?q?=E7=AB=A0=E9=93=BE=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/pages.yml | 11 ----------- script.py | 16 ++++++++++++---- 2 files changed, 12 insertions(+), 15 deletions(-) delete mode 100644 pages/pages.yml diff --git a/pages/pages.yml b/pages/pages.yml deleted file mode 100644 index b38db91..0000000 --- a/pages/pages.yml +++ /dev/null @@ -1,11 +0,0 @@ -name: pages -cards: - - header - - page1 - - page2 - - page3 - - page4 - - page5 - - page6 - - page7 - - page8 diff --git a/script.py b/script.py index a3cff53..8f8d898 100644 --- a/script.py +++ b/script.py @@ -6,7 +6,7 @@ from markdownify import markdownify as md import os response = requests.get("https://mc.boen.fun/feed",verify=False) -os.open("feed.xml",os.O_CREAT) +# os.open("feed.xml",os.O_CREAT) with open("feed.xml","w",encoding='UTF-8') as f: f.write(response.text) tree =ET.parse("feed.xml") @@ -23,8 +23,9 @@ for i in range(1,100): os.remove("libraries/"+"page"+str(i)+".md") except: pass - -os.open("pages/pages.yml",os.O_CREAT) + +os.makedirs("pages", exist_ok=True) +# os.open("pages/pages.yml",os.O_CREAT) with open("pages/pages.yml","w",encoding='UTF-8') as f: f.write("name: pages\ncards:\n - header\n") @@ -57,6 +58,7 @@ for child in root: os.open("libraries/"+"page"+str(order)+".md",os.O_CREAT) with open("libraries/"+"page"+str(order)+".md","w",encoding='UTF-8') as f: f.write("# "+title+"\n") + f.write("[文章链接]("+link+") ") f.write("发布时间: "+pubDate+"\n") f.write(MDcontent) with open("pages/pages.yml","a",encoding='UTF-8') as f: @@ -64,4 +66,10 @@ for child in root: order+=1 -os.system("builder build") \ No newline at end of file +os.system("builder build") + +# os.open("output.xaml",os.O_CREAT) +with open("output.xaml","r",encoding='UTF-8') as f: + Text=f.read().replace("IsSwaped=\"False\"","IsSwaped=\"True\"") +with open("output.xaml","w",encoding='UTF-8') as f: + f.write(Text) \ No newline at end of file