mirror of
https://github.com/tsxc-github/mzmcos--.git
synced 2025-09-10 12:57:05 +08:00
默认隐藏+文章链接
This commit is contained in:
parent
ffb2049496
commit
76ff525ae4
@ -1,11 +0,0 @@
|
|||||||
name: pages
|
|
||||||
cards:
|
|
||||||
- header
|
|
||||||
- page1
|
|
||||||
- page2
|
|
||||||
- page3
|
|
||||||
- page4
|
|
||||||
- page5
|
|
||||||
- page6
|
|
||||||
- page7
|
|
||||||
- page8
|
|
12
script.py
12
script.py
@ -6,7 +6,7 @@ from markdownify import markdownify as md
|
|||||||
import os
|
import os
|
||||||
|
|
||||||
response = requests.get("https://mc.boen.fun/feed",verify=False)
|
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:
|
with open("feed.xml","w",encoding='UTF-8') as f:
|
||||||
f.write(response.text)
|
f.write(response.text)
|
||||||
tree =ET.parse("feed.xml")
|
tree =ET.parse("feed.xml")
|
||||||
@ -24,7 +24,8 @@ for i in range(1,100):
|
|||||||
except:
|
except:
|
||||||
pass
|
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:
|
with open("pages/pages.yml","w",encoding='UTF-8') as f:
|
||||||
f.write("name: pages\ncards:\n - header\n")
|
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)
|
os.open("libraries/"+"page"+str(order)+".md",os.O_CREAT)
|
||||||
with open("libraries/"+"page"+str(order)+".md","w",encoding='UTF-8') as f:
|
with open("libraries/"+"page"+str(order)+".md","w",encoding='UTF-8') as f:
|
||||||
f.write("# "+title+"\n")
|
f.write("# "+title+"\n")
|
||||||
|
f.write("[文章链接]("+link+") ")
|
||||||
f.write("发布时间: "+pubDate+"\n")
|
f.write("发布时间: "+pubDate+"\n")
|
||||||
f.write(MDcontent)
|
f.write(MDcontent)
|
||||||
with open("pages/pages.yml","a",encoding='UTF-8') as f:
|
with open("pages/pages.yml","a",encoding='UTF-8') as f:
|
||||||
@ -65,3 +67,9 @@ for child in root:
|
|||||||
|
|
||||||
|
|
||||||
os.system("builder build")
|
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)
|
Loading…
x
Reference in New Issue
Block a user