chore: 添加式神数据抓取脚本配置文件

- 添加 scripts 目录的 package.json 和依赖配置
- 添加 README.md 说明文档
- 添加基础版本的抓取脚本
This commit is contained in:
2026-02-11 18:49:56 +08:00
parent d69349dc20
commit fb28cbb87d
4 changed files with 1040 additions and 0 deletions

36
scripts/README.md Normal file
View File

@@ -0,0 +1,36 @@
# Shikigami Scraper
This script scrapes Shikigami data from the official Onmyoji website and updates the configuration.
## Usage
1. Install dependencies:
```bash
cd scripts
npm install
```
2. Run the scraper:
```bash
npm run scrape
```
The script will:
- Fetch all Shikigami from different rarity types (SSR, SP, UR, SR, R, N, L, G)
- Download images to `public/assets/Shikigami/{rarity}/`
- Update `src/data/Shikigami.json` with the new data
## Output Structure
Images: `public/assets/Shikigami/{rarity}/{id}.png`
JSON: `src/data/Shikigami.json`
```json
[
{
"avatar": "/assets/Shikigami/ssr/596.png",
"name": "神无月",
"rarity": "SSR"
}
]
```