随机图片接口 - JSON 响应 & 客户端跳转
获取随机图片 JSON(真正随机,每次调用返回不同结果):
curl https://acg-api.pages.dev/api/random
获取随机图片 JSON(静态文件,结果固定):
curl https://username.github.io/acg-api/api/random.json
直接跳转到随机图片:
https://username.github.io/acg-api/img/random.html
# Cloudflare Pages - 真正随机(每次返回不同结果) curl https://acg-api.pages.dev/api/random curl https://acg-api.pages.dev/api/random?size=5 curl https://acg-api.pages.dev/api/anime curl https://acg-api.pages.dev/api/categories # GitHub Pages - 静态文件(结果固定) curl https://username.github.io/acg-api/api/random.json curl https://username.github.io/acg-api/api/anime.json curl https://username.github.io/acg-api/api/categories.json # 浏览器批量获取(需执行 JavaScript) https://username.github.io/acg-api/?api=random&size=5 https://username.github.io/acg-api/?api=random&category=anime&size=3
1. 将图片放入 images/分类名/ 目录
2. Push 到 master 分支
3. GitHub Actions 自动更新索引