Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pull上游 #146

Open
wants to merge 43 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
9cc9eea
refactor: 调整api模块
iDerekLi Feb 4, 2022
f8a30cc
Merge pull request #5 from iDerekLi/workflows
iDerekLi Feb 4, 2022
dad60cf
test: 测试脚本
iDerekLi Feb 4, 2022
1d61b73
Update README.md
dbl520 Feb 11, 2022
38b9315
Update README.md
dbl520 Feb 11, 2022
88236d7
fix: 修复沾喜气未执行
iDerekLi Feb 15, 2022
fe143e1
Merge pull request #7 from iDerekLi/workflows
iDerekLi Feb 15, 2022
5731379
Merge pull request #9 from MuYuLPW/main
iDerekLi Feb 28, 2022
0a2daae
Merge pull request #11 from iDerekLi/dev
iDerekLi Feb 28, 2022
ff38b76
Merge pull request #12 from iDerekLi/workflows
iDerekLi Feb 28, 2022
da74a0b
fix(email): 修复未配置邮箱报错问题
iDerekLi Mar 2, 2022
cfe4abc
refactor(checkin): 重构签到脚本
iDerekLi Mar 2, 2022
38ca7ba
chore(checkin): 更新签到执行实现
iDerekLi Mar 2, 2022
d4e67bb
Merge pull request #15 from iDerekLi/workflows
iDerekLi Mar 2, 2022
ff5ef6c
chore(checkin): 移除多余打印结果
iDerekLi Mar 2, 2022
bd2050d
Merge pull request #16 from iDerekLi/workflows
iDerekLi Mar 2, 2022
655cea7
chore(checkin): 暴露错误结果
iDerekLi Mar 2, 2022
3c06aa7
Merge pull request #17 from iDerekLi/workflows
iDerekLi Mar 2, 2022
6b6df19
chore(checkin): 调整输出格式
iDerekLi Mar 2, 2022
2f326a4
refactor(seaGold): 重构海底掘金游戏
iDerekLi Mar 2, 2022
44e59df
chore(checkin): 调试输出模板
iDerekLi Mar 2, 2022
5769fa7
Merge pull request #18 from iDerekLi/workflows
iDerekLi Mar 2, 2022
5279e73
chore(seaGold): 调整执行顺序
iDerekLi Mar 2, 2022
8d8a370
Merge pull request #19 from iDerekLi/workflows
iDerekLi Mar 2, 2022
089e2b6
Update README.md
iDerekLi Mar 3, 2022
0f51a7f
Update README.md
iDerekLi Mar 3, 2022
a0e32b6
Merge pull request #20 from iDerekLi/workflows
iDerekLi Mar 3, 2022
dd0f4b1
chore: 升级掘金助手版本
iDerekLi Mar 17, 2022
c92c245
feat: 签到脚本添加事件埋点
iDerekLi Mar 17, 2022
54beea8
Merge pull request #24 from iDerekLi/workflows
iDerekLi Mar 17, 2022
28a5707
Update README.md
dbl520 Apr 6, 2022
6e26ef7
Merge pull request #3 from iDerekLi/main
dbl520 Apr 6, 2022
a4fbad1
Merge branch 'test' into main
dbl520 Apr 6, 2022
3dccc9c
Merge pull request #4 from dbl520/main
dbl520 Apr 6, 2022
3b93d43
121
Jun 23, 2022
454df85
1
Jun 23, 2022
9edbd34
Update README.md
dbl520 Jun 23, 2022
f843231
Update package.json
dbl520 Jul 18, 2024
637b5a9
merge code
dbl520 Jul 18, 2024
be76c82
feat
dbl520 Jul 18, 2024
dd295cb
Update checkin.js
dbl520 Jul 19, 2024
7dd7a9d
Update package.json
dbl520 Jul 19, 2024
5c51f15
Update checkin.js
dbl520 Jul 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<!--
## 处理自动化相关逻辑
base: `workflows` <- compare `your branch`

## 处理JueJinAPI相关逻辑
base: `package` <- compare `your branch`
-->
8 changes: 7 additions & 1 deletion .github/workflows/checkin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: CheckIn

on:
schedule:
- cron: "30 22 * * *" # 北京时间上午06:30
- cron: "40 22 * * *" # 北京时间上午06:40
workflow_dispatch:
jobs:
CheckIn:
Expand All @@ -13,9 +13,15 @@ jobs:
- name: Run Project
env:
COOKIE: ${{ secrets.COOKIE }}
COOKIE_2: ${{ secrets.COOKIE_2 }}
COOKIE_3: ${{ secrets.COOKIE_3 }}
COOKIE_4: ${{ secrets.COOKIE_4 }}
COOKIE_5: ${{ secrets.COOKIE_5 }}
EMAIL_USER: ${{ secrets.EMAIL_USER }}
EMAIL_PASS: ${{ secrets.EMAIL_PASS }}
EMAIL_TO: ${{ secrets.EMAIL_TO }}
DINGDING_WEBHOOK: ${{ secrets.DINGDING_WEBHOOK }}
PUSHPLUS_TOKEN: ${{ secrets.PUSHPLUS_TOKEN }}
run: |
yarn
yarn checkin
6 changes: 6 additions & 0 deletions .github/workflows/seaGold.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,15 @@ jobs:
- name: Run Project
env:
COOKIE: ${{ secrets.COOKIE }}
COOKIE_2: ${{ secrets.COOKIE_2 }}
COOKIE_3: ${{ secrets.COOKIE_3 }}
COOKIE_4: ${{ secrets.COOKIE_4 }}
COOKIE_5: ${{ secrets.COOKIE_5 }}
EMAIL_USER: ${{ secrets.EMAIL_USER }}
EMAIL_PASS: ${{ secrets.EMAIL_PASS }}
EMAIL_TO: ${{ secrets.EMAIL_TO }}
DINGDING_WEBHOOK: ${{ secrets.DINGDING_WEBHOOK }}
PUSHPLUS_TOKEN: ${{ secrets.PUSHPLUS_TOKEN }}
run: |
yarn
yarn seaGold
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.DS_Store
node_modules
dist

# local env files
.env.local
Expand Down
8 changes: 8 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"tabWidth": 2,
"semi": true,
"singleQuote": false,
"printWidth": 100,
"trailingComma": "none",
"bracketSpacing": false
}
41 changes: 41 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# 参与贡献

## 分支介绍

- `package` 掘金API发布npm包,供给自动化工作流使用。
- `workflows` 自动化工作流开发分支。
- `main` 是 workflows 分支的稳定版。

**处理自动化相关逻辑:**
base: `workflows` <- compare `your branch`

**处理JueJinAPI相关逻辑:**
base: `package` <- compare `your branch`

## workflows 分支

### 安装

- `yarn` 安装依赖

### 环境变量

- `/scripts/utils/env.js` 替换本地测试所需的环境变量

```javascript
module.exports = {
COOKIE: "测试掘金Cookie",
// ...
};
```

### 本地运行

- `yarn checkin` 运行掘金签到脚本
- `yarn seagold` 运行海底掘金游戏脚本

## package 分支

- `yarn` 安装依赖
- `yarn dev` 启动开发模式
- `node tests/your-test.js` 测试一个模块
42 changes: 32 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
<section align="center">
<a href="https://github.com/iDerekLi/juejin-helper" target="_blank">
<img src="./resources/logo.svg" alt="稀土掘金" width="260" />
</a>
</section>

<h1 align="center">JuejinHelper-稀土掘金助手</h1>

<p align="center">签到、抽奖、沾喜气、海底掘金游戏、自动化工作流。</p>

## 使用

自动化执行任务: 掘金每日签到, 沾喜气, 免费抽奖, 海底掘金游戏, 最后将结果报告邮件通知订阅人。\
=======
<p align="center">签到、抽奖、沾喜气、消除Bug、海底掘金游戏、自动化工作流。</p>

## 使用

自动化执行任务: 掘金每日签到, 沾喜气, 免费抽奖, 消除Bug, 海底掘金游戏, 最后将结果报告邮件通知订阅人。\
>>>>>>> Stashed changes
自动化运行时间: 北京时间上午06:30

1. [Fork 仓库](https://github.com/iDerekLi/juejin-helper)

2. 仓库 -> Settings -> Secrets -> New repository secret, 添加Secrets变量如下:

<<<<<<< Updated upstream
| Name | Value |
| --- | --- |
| COOKIE | 掘金网站Cookie, 打开浏览器,登录 [掘金](https://juejin.cn/), 打开控制台DevTools -> Network,复制 cookie, **掘金Cookie有效期约1个月需定期更新.** |
Expand All @@ -25,12 +26,29 @@
| EMAIL_TO | 订阅人邮箱地址(收件人). 如需多人订阅使用 `, ` 分割, 例如: `[email protected], [email protected]` |

3. 仓库 -> Actions, 检查Workflows并启用。
=======
| Name | Value | Required |
| --- | --- | --- |
| COOKIE | 掘金网站Cookie | 是 |
| COOKIE_2 | 多用户, 当需要同时运行多个掘金用户时所需, 支持最多 **5** 名用户(即COOKIE + COOKIE_2 - COOKIE_5) | 否 |
| EMAIL_USER | 发件人邮箱地址(需要开启 SMTP) | 否 |
| EMAIL_PASS | 发件人邮箱密码(SMTP密码) | 否 |
| EMAIL_TO | 订阅人邮箱地址(收件人). 如需多人订阅使用 `, ` 分割, 例如: `[email protected], [email protected]` | 否 |
| DINGDING_WEBHOOK | 钉钉机器人WEBHOOK | 否 |
| PUSHPLUS_TOKEN | [Pushplus](http://www.pushplus.plus/) 官网申请,支持微信消息推送 | 否 |

4. 仓库 -> Actions, 检查Workflows并启用。
>>>>>>> Stashed changes

## 预览

| 掘金每日签到 | 海底掘金游戏 |
|:-----------:| :-------------:|
<<<<<<< Updated upstream
| ![掘金每日签到](https://user-images.githubusercontent.com/24502299/150481822-b488d30c-93b6-4d73-9e28-56c04a9413fb.png) | ![海底掘金游戏](https://user-images.githubusercontent.com/24502299/150625136-5649d2fe-b204-40aa-b8b5-7f54a44e018d.png) |
=======
| ![掘金每日签到](https://user-images.githubusercontent.com/24502299/156475511-342cfcd8-3b66-4b9c-8614-215e0b4e08a1.jpg) | ![海底掘金游戏](https://user-images.githubusercontent.com/24502299/156475550-c8cc459a-3b27-4ca6-a07b-902b65bea7a9.jpg) |
>>>>>>> Stashed changes

## 问题

Expand All @@ -51,10 +69,14 @@ DevTools截图:

[![海底掘金挑战赛](https://user-images.githubusercontent.com/24502299/151397151-0d69998a-2310-4a32-945f-c8e0035ed65d.png)](https://juejin.cn/game/haidijuejin/)

<<<<<<< Updated upstream
## 赞赏
### ☕️微信赞赏!鼓励升级!
<img src="https://user-images.githubusercontent.com/24502299/150144723-863ad914-3849-40df-8857-5ec5cd60cacd.JPG" alt="微信赞赏" width="300" />
=======
## 贡献

这个项目的存在要感谢所有做出贡献的人。 请先阅读 [[Contribute](CONTRIBUTING.md)]。
您可以将任何想法作为 [拉取请求](https://github.com/iDerekLi/juejin-helper/pulls) 或 [GitHub问题](https://github.com/iDerekLi/juejin-helper/issues) 提交。


## 许可

[MIT](./LICENSE)
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "juejin-helper",
"version": "1.0.0",
"description": "稀土掘金助手:签到、抽奖、沾喜气、海底淘金、自动化工作流。",
"version": "1.5.1",
"description": "稀土掘金助手:签到、抽奖、沾喜气、消除Bug、海底掘金游戏、自动化工作流。",
"author": "Derek Li",
"license": "MIT",
"scripts": {
Expand All @@ -11,8 +11,10 @@
},
"dependencies": {
"fast-astar": "^1.0.6",
"juejin-helper": "^1.7.2",
"jsonwebtoken": "^8.5.1",
"node-fetch": "^2.6.1",
"juejin-helper": "^1.5.1",
"nodemailer": "^6.7.0"
},
"repository": {
Expand Down
57 changes: 0 additions & 57 deletions scripts/api/api.js

This file was deleted.

67 changes: 0 additions & 67 deletions scripts/api/juejin-api.js

This file was deleted.

Loading