This repository has been archived on 2024-05-11. You can view files and clone it, but cannot push or open issues or pull requests.
review-2021/main.py

53 lines
1.8 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import os
flag = 0
markdown = """# 2021年终总结
<!-- 此处待完善 -->
目前已收集170+篇年终总结。数据来源: [『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)
---
| Article | Blog\_ID | IA\_Archived |
| --- | --- | --- |"""
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') #Ver1
f.write(markdown+'\n'+line+'\n')
flag = 1
else:
#f.write('- '+line+'\n') #Ver1
f.write(line+'\n')