Go to file
Your Name e371a1373d 更新模板 2023-09-05 20:40:09 +08:00
template 更新模板 2023-09-05 20:40:09 +08:00
utils Update 2023-06-19 16:52:00 +08:00
README.md Update 2023-06-19 14:34:32 +08:00
img1.png Add files via upload 2023-05-05 21:58:36 +08:00
main.py Update 2023-06-19 17:10:26 +08:00
url_check.ipynb Update 2023-06-19 16:52:00 +08:00

README.md

Source Code

File Illustration

.
├── README.md
├── img1.png
├── main.py
├── template
│   └── README.md # 模板
├── url_check.ipynb # 一个检查url的脚本
└── utils # 一些工具方法
    ├── __init__.py
    ├── data.py
    ├── jinja.py
    └── url_check.py


Rank

    # 按权重排序
    # 权重 基本为 免费,登录,付费
    data1.extend(sort_site(data.free_star, gfw=False))
    data1.extend(sort_site(data.free))
    data1.extend(sort_site(data.deng_lu))
    data1.extend(sort_site(data.charge))
    # 打乱
    random.shuffle(data.miao_zhan)
def sort_site(items, gfw=True):
    items = sorted(items, key=lambda x: x.weight, reverse=True)
    if gfw:
        items_g = [x for x in items if x.gfw == 1]
        items_g.extend([x for x in items if x.gfw != 1])
        items = items_g
    return items

GitHubAction Auto sync(弃用)

GitHubAction每十分钟自动同步 dev 分支README.md 请开起Action 可读写仓库

开启方法:

  1. Actions permissions -->[✔]Allow all actions and reusable workflows # 允许action运行
  2. Workflow permissions-->[✔]Read and write permissions # 给与action读写权限
name: Sync
on:
  schedule:
    - cron: '*/10 * * * *'
jobs:
  sync-readme:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v2
        with:
          ref: main # 要同步的分支
      - name: Download README.md
        run: |
          curl  -o README.md https://raw.githubusercontent.com/xx025/carrot/main/README.md
          echo "$(cat README.md)"$'\n\n>Last synced:BeiJingT '"$(TZ='Asia/Shanghai' date +'%Y-%m-%d %H:%M:%S')" > README.md          
      - name: Setup Node.js
        uses: actions/setup-node@v2
        with:
          node-version: '16.x'
      - name: Set up Git user
        run: |
          git config --global user.email "actions@github.com"
          git config --global user.name "GitHub Actions"          
      - name: Check if changes exist
        run: |
          if git diff-index --quiet HEAD --; then
            echo "No changes to commit. Exiting."
          else
            git add README.md
            git commit -m "Sync README to main branch"
            git push origin HEAD:refs/heads/main
          fi          

Star History

star-history