开始收集 2022 的年终总结

This commit is contained in:
yzqzss 2022-12-19 21:07:30 +08:00
parent f17e82a3ba
commit 08912b052d
4 changed files with 92 additions and 1 deletions

34
.github/workflows/main.yml vendored Executable file
View File

@ -0,0 +1,34 @@
# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [ main ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2.3.0
- name: Run a one-line script
run: python main.py
- name: Commit files
run: |
git config --local user.email "actions@github.com"
git config --local user.name "GitHub Action"
git add .
git commit -m "gen README.md"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

View File

@ -6,7 +6,7 @@
链接后面的数字是我们对每个博客分配的博客ID有什么用呢自行探索其它仓库。
**想要添加您的年终总结?请发 Issue 或有能力者自行编辑 metadata.md 发PR不需要填写博客ID。**
**想要添加您的年终总结?请发 Issue 或编辑 metadata.md 发PR不需要填写博客ID。**
---
@ -18,3 +18,7 @@
- 待确定
---
| Article | Blog\_ID | IA\_Archived |
| --- | --- | --- |

51
main.py Normal file
View File

@ -0,0 +1,51 @@
import os
flag = 0
markdown = """# 2022年终总结
<!-- 此处待完善 -->
本项目将长期维护直到2024年初因为[以往的经验](https://t.me/blogrsslist/269)告诉我有些博主的年终总结可能要[拖拉个半年才写得完](https://idealclover.top/archives/627/)还有些博主明明都年中了才写完了上一年的年终总结又觉得不好意思[而自己把文章发布时间改成年初](https://github.com/saveweb/review-2021/commit/558ba32ef42025dd1bf2da31c2c1fb60e05e2524)掩耳盗铃有趣有趣
链接后面的数字是我们对每个博客分配的博客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)
| --- | --- | --- |
### 友情链接:
- 待确定
---
"""
with open('metadata.md', 'r') as f:
file = f.read()
lines = file.splitlines()
header = lines[0:2]
# print(header)
# import sys
# sys.exit(0)
lines = set(lines[2:])
lines.discard('')
lines = list(lines)
lines.sort()
# with open('metadata.md', 'w') as f:
# for line in header:
# f.write(line+'\n')
# for line in lines:
# f.write(line+'\n')
with open('README.md', 'w') as f:
f.write(markdown+'\n')
for line in header:
f.write(line+'\n')
lines = set(lines)
for line in lines:
f.write(line+'\n')

2
metadata.md Normal file
View File

@ -0,0 +1,2 @@
| Article | Blog\_ID | IA\_Archived |
| --- | --- | --- |