Coder Social home page Coder Social logo

dogfeeling / juejin-actions Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ruochuan12/juejin-actions

0.0 1.0 0.0 986 KB

掘金每天自动签到 github actions 。组织了每周一起学习200行左右的【源码共读】活动,感兴趣可以加我微信 ruochuan12 参与。

JavaScript 100.00%

juejin-actions's Introduction

juejin-actions

每天掘金自动签到 时间自定义,默认11: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

新建项目或者已有项目

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

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

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

test 文件夹新增 cookie.js 文件代码如下:

export const cookie = '你在掘金的cookie';

本地测试

npm run test

juejin-actions's People

Contributors

ruochuan12 avatar

Watchers

 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.