forked from saveweb/review-2021
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
47 lines (33 loc) · 1.66 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import os
flag = 0
markdown = """# 2021年终总结
<!-- 此处待完善 -->
目前已收集130+篇年终总结。数据来源: [『saveweb/rss-list: 独立博客&播客全订阅计划!』](https://github.com/saveweb/rss-list),持续收集中,部分数据(30篇)同步自[友台:『@FindBlog』](https://t.me/FindBlog/52)。
本项目将长期维护(直到2023年初),因为[以往的经验](https://t.me/blogrsslist/269)告诉我——有些博主的年终总结可能要[拖拉个半年才写得完](https://idealclover.top/archives/627/),还有些博主明明都年中了才写完了上一年的年终总结,又觉得不好意思而自己把文章发布时间改成年初,掩耳盗铃。有趣有趣……
链接后面的数字是我们对每个博客分配的博客ID,有什么用呢?自行探索其它仓库。
**想要添加您的年终总结?请发 Issue 或有能力者自行编辑 metadata.md 并发PR(不需要填写博客ID)。**
---
### 相关链接:
| [Save The Web's Telegram Channel](https://t.me/saveweb) | [独立博客&播客全订阅's Telegram Channel](https://t.me/blogrsslist) | [Github Org](https://github.com/saveweb)
| --- | --- | --- |
### 友情链接:
[Find Blog👁发现博客](https://t.me/FindBlog)
---
"""
with open('metadata.md', 'r') as f:
file = f.read()
lines = file.splitlines()
lines = set(lines)
lines.discard('')
lines = list(lines)
lines.sort()
with open('metadata.md', 'w') as f:
for line in lines:
f.write(line+'\n')
with open('README.md', 'w') as f:
for line in lines:
if flag == 0:
f.write(markdown+'\n'+'- '+line+'\n')
flag = 1
else:
f.write('- '+line+'\n')