mirror of
https://github.com/tsxc-github/mzmcos--.git
synced 2025-09-10 07:29:17 +08:00
✨ 你知道吗
This commit is contained in:
parent
8277662f20
commit
0ba9eeb6a1
5
Tips.yaml
Normal file
5
Tips.yaml
Normal file
@ -0,0 +1,5 @@
|
||||
"Tips":
|
||||
- "你知道吗:加载器的发行代号其实是绵中的各个楼以正大门为原点从近到远排的"
|
||||
- "热知识:boen的饼一般会在三年内完成"
|
||||
- "热知识:boen负责画饼,烙饼负责烙……"
|
||||
- "😨知识:烙饼说他想让全服的人只能用加载器进服"
|
@ -1,3 +1,4 @@
|
||||
<local:MyHint Margin="0,8,0,2" IsWarn="False" Text="$你知道吗$" />
|
||||
<local:MyCard Margin="0,10,0,14">
|
||||
<Border BorderBrush="{DynamicResource ColorBrush2}" Margin="-0.6" CornerRadius="5" BorderThickness="0,0,0,10">
|
||||
<StackPanel>
|
||||
@ -26,4 +27,4 @@
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</local:MyCard>
|
||||
</local:MyCard>
|
||||
|
@ -1,4 +1,5 @@
|
||||
datetime
|
||||
requests
|
||||
markdownify
|
||||
python-dateutil
|
||||
python-dateutil
|
||||
pyyaml
|
13
script.py
13
script.py
@ -4,6 +4,8 @@ import xml.etree.ElementTree as ET
|
||||
from dateutil.parser import parse
|
||||
from markdownify import markdownify as md
|
||||
import os
|
||||
import random
|
||||
import yaml
|
||||
|
||||
response = requests.get("https://mc.boen.fun/feed",verify=False)
|
||||
# os.open("feed.xml",os.O_CREAT)
|
||||
@ -68,7 +70,18 @@ for child in root:
|
||||
os.system("mkdir public")
|
||||
os.system("builder build --output-path public/output.xaml")
|
||||
|
||||
# 将卡片设置为折叠
|
||||
with open("public/output.xaml","r",encoding='UTF-8') as f:
|
||||
Text=f.read().replace("IsSwaped=\"False\"","IsSwaped=\"True\"")
|
||||
with open("public/output.xaml","w",encoding='UTF-8') as f:
|
||||
f.write(Text)
|
||||
|
||||
# 随机添加一条你知道吗
|
||||
with open("Tips.yaml","r",encoding='UTF-8') as f:
|
||||
Tips=yaml.load(f.read(),Loader=yaml.FullLoader)["Tips"]
|
||||
Tip=Tips[random.SystemRandom().randint(0,len(Tips)-1)]
|
||||
|
||||
with open("public/output.xaml","r",encoding='UTF-8') as f:
|
||||
Text=f.read().replace("$你知道吗$",Tip)
|
||||
with open("public/output.xaml","w",encoding='UTF-8') as f:
|
||||
f.write(Text)
|
Loading…
x
Reference in New Issue
Block a user