Coder Social home page Coder Social logo

juejin-actions's Introduction

juejin-actions

2月18日,由于掘金政策不允许,梅楼封发布的警告封号处理消息,可能被封号,所以我禁用了,无法正常签到了。大家可以学习本仓库。另外欢迎添加我的微信 ruochuan12,参加近3000人报名的 源码共读活动,学会看源码相当于打开了新的世界,成长会比较快。

每天掘金自动签到 时间自定义,默认8:00

你好,我是若川。目前持续组织了5个月每周一起学200行左右源码共读活动,每周一期,已进行到20期,感兴趣的可以加我微信 ruochuan12 加群参与,长期交流学习。

使用

fork 我的项目

在项目 settings => secrets 添加 JUEJIN_COOKIE 字段,设置值为掘金 cookie,设置好可以手动触发一次,验证是否正确,下次就会定时触发了,再也不用担心签到了。

掘金 cookie 好像一个月内有效,退出登录后也无效,需要及时更换 cookie

设置 secrets

首次手动触发 workflow

如图所示,就成功了。

workflow 签到结果

获取 掘金 cookie 方法

打开这个页面,登录后,按F12打开开发者工具,刷新页面

fetch/xhr 搜索过滤 get_today_status 这个接口,在 Request Headers 中复制 cookie 的值。如下图所示:

获取 cookie

开启邮箱发送日志的服务

在项目 settings => secrets 中需要额外添加以下字段

字段名 含义 默认值
MAIL_SENDER 发送方邮箱 -
SMTP_PASSWORD 发送方SMTP服务的授权码或者口令 -
MAIL_HOST_SENDER 发送邮件服务器 smtp.qq.com
MAIL_PORT_SENDER 发送邮件服务器的端口号 465
MAIL_RECIPIENT 邮件接受方 -

以QQ邮箱为例

获取授权码

字段名 举例
MAIL_SENDER [email protected](自己邮箱)
SMTP_PASSWORD 上图获取的授权码
MAIL_HOST_SENDER smtp.qq.com
MAIL_PORT_SENDER 465
MAIL_RECIPIENT [email protected](自己邮箱)

新建项目或者已有项目

添加 .github/workflows/main.yml 文件,其中 main 可以自定义成其他名称。

on:
  push:
  schedule:
    # 定时任务 每天 8:00 自动签到,按照计划任务队列,可能延迟 0 + 8 = 北京时间 8
    - cron: '00 0 * * *'

jobs:
  juejin:
    runs-on: ubuntu-latest
    name: 掘金自动签到
    steps:
      - name: Hello world action step
        id: hello
        uses: lxchuan12/juejin-actions@main
        env:
          JUEJIN_COOKIE: ${{secrets.JUEJIN_COOKIE}}
        with:
          who-to-greet: '若川'
      # Use the output from the `hello` step
      - name: Get the output
        run: |
          echo "The time was ${{ steps.hello.outputs.time }}"
          echo "签到结果: ${{ steps.hello.outputs.checkInResult }}"

同样在项目 settings => secrets 添加 JUEJIN_COOKIE 字段,设置值为掘金 cookie

本地开发

# git clone https://github.com/lxchuan12/juejin-actions.git
npm i -g pnpm
pnpm install

# 提交 commit 消息用以下命令,使用了(git-cz)
pnpm run commit
# npm run commit

本地测试

test/env.js 文件代码配置相应配置。

npm run test

TODOs

  • 根据 cookie 自动签到
  • 邮件通知
  • 加入每天免费抽奖功能
  • 加入 eslint
  • 加入 .env 文件

juejin-actions's People

Contributors

ruochuan12 avatar fyzhu avatar sneaken avatar geekqc 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.