Skip to content

Commit

Permalink
feat: refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
yuki committed Dec 16, 2022
1 parent c5c5d97 commit f2575c2
Show file tree
Hide file tree
Showing 8 changed files with 463 additions and 168 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
lib/
node_modules/
package-lock.json
41 changes: 40 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,41 @@
# kokkoro-plugin-saucenao
Locating image sources

> SauceNAO 图片搜索
## 安装

```shell
# 切换至 bot 目录
cd bot

# 安装 npm 包
npm i kokkoro-plugin-saucenao
```

## 配置项

```typescript
interface SaucenaoOption extends Option {
/** 结果返回数 */
results: number;
/** 数据库索引数组,例如只搜索 Pixiv [5] */
mask: number[];
/** 数据库索引(结果排除) */
excludeMask: number[];
/** 测试模式 */
testMode: boolean;
/** 搜索特定数据库索引而不必生成掩码 */
db: number;
/** 最低相似度,低于该数值的略缩图将会和谐 */
similarity: number;
}
```

## 环境变量

你可以在项目根目录下创建 `.env` 文件

```ini
# API key
SAUCENAO_API_KEY=3d14159265358979323846264338327950288419
```
17 changes: 10 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "kokkoro-plugin-saucenao",
"version": "0.0.1",
"description": "Locating image sources",
"main": "./lib/index.js",
"version": "1.0.0",
"description": "SauceNAO 图片搜索",
"main": "lib/index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
Expand All @@ -13,18 +13,21 @@
"keywords": [
"kokkoro"
],
"author": "yuki",
"author": "yuki <mail@yuki.sh>",
"license": "MIT",
"bugs": {
"url": "https://github.com/kokkorojs/kokkoro-plugin-saucenao/issues"
},
"homepage": "https://github.com/kokkorojs/kokkoro-plugin-saucenao#readme",
"devDependencies": {
"@types/node": "^17.0.23",
"kokkoro": "^0.3.0"
"@types/node": "^18.11.15",
"kokkoro": "^1.2.9"
},
"files": [
"lib",
"images"
]
],
"dependencies": {
"sagiri": "^3.2.4"
}
}
305 changes: 305 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit f2575c2

Please sign in to comment.