Giter VIP home page Giter VIP logo

serverchan-push's Introduction

Serve酱自动推送热门

🔝 通过Serve酱自动发送微博、知乎、v2ex热门内容到微信,可配置 workflow 的触发条件为 schedule,实现周期性定时发送热门内容。

示例

clone 此 GitHub 仓库,修改.github/workflows/ 文件夹下一个 main.yml 文件,内容如下:

name: 'Push News'

on:
  push:
    branches:
      - master
  schedule:
    - cron: '0 */3 * * *' # 定义 cron 表达式
  watch:
    types: [started] # 定义star是自动发送

env:
  TZ: Asia/Shanghai

jobs:
  Gitfolio-Spider:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2
      - name: 'Set up Python'
        uses: actions/setup-python@v1
        with:
          python-version: 3.8
      - name: 'Install dependencies'
        run: python -m pip install --upgrade pip
      - name: 'Install requirements'
        run: pip install -r ./requirements.txt
      - name: 'Working'
        env:
          SECRET: ${{ secrets.SECRET }}
        timeout-minutes: 350
        run: |
          echo SECRET=$SECRET > .env
          python main.py
          rm -f .env

注意

  • cron 是 UTC 时间,使用时请将北京时间转换为 UTC 进行配置。
  • 请在项目的 Settings -> Secrets 路径下配置好SECRET(server酱密钥),不要直接在 .yml 文件中暴露地址跟密钥
  • SECRET 设置为 xxxxxx

效果

serverchan-push's People

Contributors

wangningkai avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.