This repository has been archived by the owner on Jul 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 382
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
67 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1,3 @@ | ||
# 头脑王者 | ||
|
||
爬取题库、答题辅助 | ||
|
||
## 准备 | ||
|
||
- Node.js 9.x 以上 | ||
- MongoDB | ||
- 安装依赖 `npm i` | ||
|
||
## 功能 | ||
|
||
### 爬取题库 | ||
|
||
> 爬题思路:不断进行好友对战获取题目,随意提交答案会返回正确答案,存入数据库,重复的忽略 | ||
分别使用两个微信号登录游戏,抓登录的请求,复制返回的 `uid` 和 `token` | ||
|
||
填入 [src/crawl.js](src/crawl.js) 中,执行 `npm run crawl` 开始自动爬取 | ||
|
||
如果出现 “上局异常退出,请重新登录” 的提示,先退出爬题脚本,用第一个微信号**完全退出游戏进程**,重新进入游戏,再重新爬即可 | ||
|
||
爬题需要一定的时间,也可以直接导入[我爬好的题库 MongoShell BSON(.json)](quizzes.json)(近 1.7w 题)数据库名为 `tnwz` | ||
|
||
导入命令,注意你的文件路径 | ||
|
||
```bash | ||
mongoimport -d tnwz -c quizzes --file ~/Downloads/quizzes.json --jsonArray --drop | ||
``` | ||
|
||
### 答题辅助 | ||
|
||
执行 `npm run ca` 生成 RootCA,将生成的证书安装到手机上,并在手机上设置代理 IP(电脑的局域网 IP) 和 端口(8001) | ||
|
||
证书配置遇到困难可以看[这里](http://anyproxy.io/cn/#%E8%AF%81%E4%B9%A6%E9%85%8D%E7%BD%AE) | ||
|
||
一切都配置好之后,**完全退出游戏进程**,执行 `npm run robot`,再重新进入游戏 | ||
|
||
答题时,如果该题在题库中,终端会输出正确答案,手机上正确答案前面会显示一个 `√` | ||
|
||
如果本题不在题库里,会自动打开百度搜索答案,并将本题正确答案记录到题库中 | ||
|
||
## 截图 | ||
|
||
<table> | ||
<tr> | ||
<td> | ||
<img src="https://user-images.githubusercontent.com/8413791/35086936-551678b8-fc69-11e7-8e58-a75ad403ffde.png" alt="王者截图"> | ||
</td> | ||
<td> | ||
<img src="https://user-images.githubusercontent.com/8413791/35084177-a7642b58-fc5d-11e7-9774-10a0b17dc39c.png" alt="辅助截图"> | ||
</td> | ||
</tr> | ||
</table> | ||
|
||
![爬取截图](https://user-images.githubusercontent.com/8413791/35079048-36290192-fc40-11e7-9514-036e786dbe5d.png) | ||
|
||
![题库截图](https://user-images.githubusercontent.com/8413791/35079110-7303a0a4-fc40-11e7-9e09-1b67415d8855.png) | ||
“头脑王者” 小程序违规被封,已改名为 [知乎答题王](../知乎答题王) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,58 @@ | ||
# 知乎答题王 | ||
|
||
由于头脑王者违规被封,改名为知乎答题王,所以目前直接使用 [头脑王者](../头脑王者) 的辅助即可 | ||
爬取题库、答题辅助 | ||
|
||
## 准备 | ||
|
||
- Node.js 9.x 以上 | ||
- MongoDB | ||
- 安装依赖 `npm i` | ||
|
||
## 功能 | ||
|
||
### 爬取题库 | ||
|
||
> 爬题思路:不断进行好友对战获取题目,随意提交答案会返回正确答案,存入数据库,重复的忽略 | ||
分别使用两个微信号登录游戏,抓登录的请求,复制返回的 `uid` 和 `token` | ||
|
||
填入 [src/crawl.js](src/crawl.js) 中,执行 `npm run crawl` 开始自动爬取 | ||
|
||
如果出现 “上局异常退出,请重新登录” 的提示,先退出爬题脚本,用第一个微信号**完全退出游戏进程**,重新进入游戏,再重新爬即可 | ||
|
||
爬题需要一定的时间,也可以直接导入[我爬好的题库 MongoShell BSON(.json)](quizzes.json)(近 1.7w 题)数据库名为 `zhdtw` | ||
|
||
导入命令,注意你的文件路径 | ||
|
||
```bash | ||
mongoimport -d zhdtw -c quizzes --file ~/Downloads/quizzes.json --jsonArray --drop | ||
``` | ||
|
||
### 答题辅助 | ||
|
||
执行 `npm run ca` 生成 RootCA,将生成的证书安装到手机上,并在手机上设置代理 IP(电脑的局域网 IP) 和 端口(8001) | ||
|
||
证书配置遇到困难可以看[这里](http://anyproxy.io/cn/#%E8%AF%81%E4%B9%A6%E9%85%8D%E7%BD%AE) | ||
|
||
一切都配置好之后,**完全退出游戏进程**,执行 `npm run robot`,再重新进入游戏 | ||
|
||
答题时,如果该题在题库中,终端会输出正确答案,手机上正确答案前面会显示一个 `√` | ||
|
||
如果本题不在题库里,会自动打开百度搜索答案,并将本题正确答案记录到题库中 | ||
|
||
## 截图 | ||
|
||
<table> | ||
<tr> | ||
<td> | ||
<img src="https://user-images.githubusercontent.com/8413791/35086936-551678b8-fc69-11e7-8e58-a75ad403ffde.png" alt="王者截图"> | ||
</td> | ||
<td> | ||
<img src="https://user-images.githubusercontent.com/8413791/35084177-a7642b58-fc5d-11e7-9774-10a0b17dc39c.png" alt="辅助截图"> | ||
</td> | ||
</tr> | ||
</table> | ||
|
||
![爬取截图](https://user-images.githubusercontent.com/8413791/35079048-36290192-fc40-11e7-9514-036e786dbe5d.png) | ||
|
||
![题库截图](https://user-images.githubusercontent.com/8413791/36367267-dbb177ce-158c-11e8-8c82-2eae80263a43.png) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters