nodejs + github actions 实现百度贴吧自动签到

前段时间想用云函数的方式进行百度贴吧的签到,无奈云函数的超时时间最多只能为60秒,还没开始签就结束了,所以就改用了 github actions执行 nodejs 脚本来实现。

开源地址:​​https://github.com/xuedingmiaojun/tbautosign ​

​​#​​ action 文件内容一览

action.yml



name: nodejs tb autosign

on:
push:
gollum:
schedule:
- cron: '0 11,21 * * *'

jobs:
one:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
# 使用 node:10
- name: use Node.js 10.x
uses: actions/setup-node@v1
with:
node-version: 10.x
# npm install
- name: npm install and do sign
env:
BDUSS: ${{ secrets.BDUSS }}
run: |
npm install
node index.js


​​#​​ 用法

​​#​​ 1.fork 项目

​​#​​ 2.获取 BDUSS

网页中登录贴吧,然后打开『开发者工具』,找到 BDUSS



Application->Storage->Cookies




nodejs 版利用 github actions 进行百度贴吧自动签到_nodejs


​​#​​ 3.将 BDUSS 添加到仓库的 Secrets 中



nodejs 版利用 github actions 进行百度贴吧自动签到_python_02


多用户按如下格式添加。



BDUSS1&&BDUSS2


​​#​​ 4.开启 actions

默认actions是处于禁止的状态,需要手动开启。

​​#​​ 5.运行 actions

  • 自己提交​​push​
  • 每天早上十一点和下午九点将会进行签到

​​#​​ 效果截图



nodejs 版利用 github actions 进行百度贴吧自动签到_nodejs_03


​​#​​ 参考资料