From c97bbb63f49a090d9c2e6aef56cb8d2e5ff6c67a Mon Sep 17 00:00:00 2001 From: chenxv399 Date: Mon, 25 Nov 2024 15:30:46 +0800 Subject: [PATCH] Update README --- README.md | 106 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ tasks.db | Bin 12288 -> 12288 bytes 2 files changed, 106 insertions(+) diff --git a/README.md b/README.md index e69de29..6b20a32 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,106 @@ +# flinkvertify-友链自动验证API + +## 项目介绍 +这个程序是用于在他人申请你的网站的友链时,自动验证他是否已经添加你的网站信息到他的网站的友链页面,可以更方便的验证双向友链。 + +### 功能逻辑 +通过API传入需要验证的网站的友链页面的URL,例如“https://example.com/links",程序会自动抓取页面并验证页面上是否存在你需要验证的信息。再通过API传入查询请求,即可获得结果。 + +--- + +## 使用方法 + +### 直接使用 +1. 下载Releases中的程序到你的服务器 + +2. 运行程序,替换三个变量 +`./flinkvertify -n="你的网站名称" -d="你的网站简介" -p=8080` + +3. 程序默认输出示例如下 +`2024/11/25 12:00:00 检测网站名称: example +2024/11/25 12:00:00 检测网站简介: domain +2024/11/25 12:00:00 运行端口: 8080 +2024/11/25 12:00:00 Server started with API Key: NHYKURNOMGHTHNVN` + +4. 后台运行 +将程序注册成系统服务,使用systemctl管理,方法自行搜索 + +### 编译使用 +如果你不想用我编译好的程序,请使用**最新版本**的Golang自行搭建Go环境编译 + +--- + +## API详情 + +#### **1. 提交任务** +- **Endpoint**: `/api/task` +- **Method**: `POST` +- **Headers**: + - `Content-Type: application/json` + - `X-API-Key`: [程序运行后输出的API KEY] +- **Request Body**: + ```json + { + "url": "https://example.com" + } + ``` +- **Response**: + - **成功**: + ```json + { + "task_id": "b2f7412b-1234-5678-9012-abcdef123456" + } + ``` + +--- + +#### **2. 查询任务结果** +- **Endpoint**: `/api/result` +- **Method**: `GET` +- **Headers**: + - `X-API-Key`: [程序运行后输出的API KEY] +- **Query Parameters**: + - `taskid`: 提交任务时返回的 `task_id` +- **Response**: + - **处理中**: + ```json + { + "status": "processing" + } + ``` + - **完成**(关键词存在): + ```json + { + "result": true, + "status": "success", + "task_id": "1732513329707151250" + } + ``` + - **完成**(关键词不存在): + ```json + { + "result": false, + "status": "success", + "task_id": "1732513329707151250" + } + ``` + - **任务失败**: + ```json + { + "result": false, + "status": "failure", + "task_id": "1732519356077725251" + } + ``` + +--- + +## 开发与贡献 + +* 欢迎提出改进和建议,有问题请提交Issue + +--- + +## 许可 + +MIT License. \ No newline at end of file diff --git a/tasks.db b/tasks.db index 78a2569f7b98d43b933f17525df195d647c05973..d8637e28d603ad727ba7d5b78c330f9ac0afbc43 100644 GIT binary patch delta 192 zcmZojXh@hK%_u%m#+gxkW5N=C4kmsc2L4ulp3OW0|M=u8naY{ijdi6tf`bjsjg3qV zEsagh49v~VjZA@@$qsT#)`q55Mn+b~W_n;@OH)HLZ37D{0|O%iBNJUiLtP_N1-KF; zGZRZAGYeA_h?2>z^7TLqFEa4IHzBscnBNm&O#F&jaA>ziyMwaFV=7y$* HMy3V;OY$k> delta 173 zcmZojXh@hK%_uri#+gxcW5N=C4o3b~2L4t)mCZZ?|M(QO4J@n-3>X*~J{U`L`uiK2 z8ylIJ8=9D#SQ=ZHS(;cHOkNWnf}uY@!Dhom?m