You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
# Hero Union - 英雄联盟
|
|
|
|
|
|
|
|
Union of hero bots.
|
|
|
|
一个Hero的爬虫联盟。
|
|
|
|
|
|
|
|
Hero Union主要做两件事:
|
|
|
|
|
|
|
|
* 加入联盟的爬虫将定期到联盟领取网页抓取任务,并将任务结果回传
|
|
|
|
* 对外提供提交网页抓取任务和获取任务结果的接口供联盟成员使用,并支持任务完成回调通知
|
|
|
|
|
|
|
|
|
|
|
|
## Hero Union 英雄联盟使用流程
|
|
|
|
|
|
|
|
### 联盟成员使用流程
|
|
|
|
|
|
|
|
1. 调用接口向联盟提交网页抓取任务
|
|
|
|
2. 任务完成时联盟会主动通知回传任务结果
|
|
|
|
3. 也可以调用接口查询任务结果
|
|
|
|
|
|
|
|
|
|
|
|
### 联盟的爬虫工作流程
|
|
|
|
|
|
|
|
1. 本地启动爬虫后,定期向联盟上报爬虫状态
|
|
|
|
2. 爬虫定期向联盟领取新的网页抓取任务
|
|
|
|
3. 爬虫完成网页抓取任务时调用接口上报给联盟
|
|
|
|
|
|
|
|
|
|
|
|
## Hero Union 联盟接口
|
|
|
|
|
|
|
|
Hero Union联盟网站:[Hero Union英雄联盟](https://herounion.filesite.io/)。
|
|
|
|
|
|
|
|
以下为联盟所有接口的详细文档:
|
|
|
|
|
|
|
|
### 爬虫任务领取接口
|
|
|
|
|
|
|
|
* 接口网址:
|
|
|
|
```
|
|
|
|
https://herounion.filesite.io/api/gettask/
|
|
|
|
```
|
|
|
|
* 请求方法:**GET**
|
|
|
|
* 请求参数:**无**
|
|
|
|
|
|
|
|
|
|
|
|
### 爬虫任务完成回传接口
|
|
|
|
|
|
|
|
* 接口网址:
|
|
|
|
```
|
|
|
|
https://herounion.filesite.io/api/savetask/
|
|
|
|
```
|
|
|
|
* 请求方法:**POST**
|
|
|
|
* 请求参数:
|
|
|
|
```
|
|
|
|
task_id
|
|
|
|
task_result
|
|
|
|
timestamp
|
|
|
|
sign
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
### 提交网页抓取任务接口
|
|
|
|
|
|
|
|
* 接口网址:
|
|
|
|
```
|
|
|
|
https://herounion.filesite.io/api/newtask/
|
|
|
|
```
|
|
|
|
* 请求方法:**POST**
|
|
|
|
* 请求参数:
|
|
|
|
```
|
|
|
|
url
|
|
|
|
selectors
|
|
|
|
token
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
### 查询网页抓取任务结果接口
|
|
|
|
|
|
|
|
* 接口网址:
|
|
|
|
```
|
|
|
|
https://herounion.filesite.io/api/querytask/
|
|
|
|
```
|
|
|
|
* 请求方法:**GET**
|
|
|
|
* 请求参数:
|
|
|
|
```
|
|
|
|
task_id
|
|
|
|
timestamp
|
|
|
|
sign
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
### 爬虫任务完成回调通知接口
|
|
|
|
|
|
|
|
* 接收通知网址:
|
|
|
|
```
|
|
|
|
见提交网页抓取任务接口中的参数:notify_url
|
|
|
|
```
|
|
|
|
* 请求方法:**POST**
|
|
|
|
* 请求参数:
|
|
|
|
```
|
|
|
|
task_id
|
|
|
|
task_result
|
|
|
|
timestamp
|
|
|
|
sign
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
### 爬虫状态上报接口
|
|
|
|
|
|
|
|
* 接口网址:
|
|
|
|
```
|
|
|
|
https://herounion.filesite.io/api/onboard/
|
|
|
|
```
|
|
|
|
* 请求方法:**POST**
|
|
|
|
* 请求参数:
|
|
|
|
```
|
|
|
|
bot_name
|
|
|
|
status: [idle, busy]
|
|
|
|
timestamp
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
### 联盟状态查询接口
|
|
|
|
|
|
|
|
* 接口网址:
|
|
|
|
```
|
|
|
|
https://herounion.filesite.io/api/stats/
|
|
|
|
```
|
|
|
|
* 请求方法:**GET**
|
|
|
|
* 请求参数:**无**
|
|
|
|
|
|
|
|
|
|
|
|
## Hero Union 英雄联盟开发进度
|
|
|
|
|
|
|
|
更新日期:2023-11-05
|
|
|
|
|
|
|
|
* v0.1 - beta 开发中...
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## 参考
|
|
|
|
|
|
|
|
npm install 使用代理,本地socks转web proxy软件:
|
|
|
|
```
|
|
|
|
https://www.npmjs.com/package/http-proxy-to-socks
|
|
|
|
```
|
|
|
|
|
|
|
|
启动代理软件:
|
|
|
|
```
|
|
|
|
hpts -s 127.0.0.1:1080 -p 8002
|
|
|
|
```
|
|
|
|
|