diff --git a/.github/workflows/auto-refresh.yml b/.github/workflows/auto-refresh.yml new file mode 100644 index 0000000..76b1a79 --- /dev/null +++ b/.github/workflows/auto-refresh.yml @@ -0,0 +1,20 @@ +name: Auto Refresh + +on: + schedule: + - cron: '20 0-17,22,23 * * *' + workflow_dispatch: + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - uses: actions/setup-node@v4 + with: + node-version: lts/* + + - run: npx tsx ./scripts/refresh.ts diff --git a/scripts/refresh.ts b/scripts/refresh.ts new file mode 100644 index 0000000..f710370 --- /dev/null +++ b/scripts/refresh.ts @@ -0,0 +1,11 @@ +import { sources } from "../shared/sources" +import { delay } from "../shared/utils" + +async function main() { + for (const id of Object.keys(sources)) { + await delay(100) + fetch(`https:newsnow.busiyi/api/s/${id}`) + } +} + +main().catch(console.error)