chore: optimize readme

This commit is contained in:
dsrkafuu 2022-03-13 19:20:12 +08:00
parent b1a6c6fd00
commit 37a725fadd
1 changed files with 21 additions and 26 deletions

View File

@ -2,31 +2,27 @@
Fork of Moe Counter for fast global access powered by Cloudflare Workers.
[Source Project](https://github.com/journey-ad/Moe-counter) | [Cloudflare Workers](https://workers.cloudflare.com/) | [Workers KV](https://www.cloudflare.com/products/workers-kv/)
[Original Project](https://github.com/journey-ad/Moe-counter) | [Cloudflare Workers](https://workers.cloudflare.com/) | [Cloudflare Workers KV](https://www.cloudflare.com/products/workers-kv/)
## Demo
![Gelbooru](https://count.dsrkafuu.net/dsrkafuu:demo?theme=gelbooru)
<details>
<summary>More Themes</summary>
<summary>More Themes and Customizations</summary>
**A-SOUL**
**A-SOUL (with `theme=asoul&length=10`)**
![A-SOUL](https://count.dsrkafuu.net/dsrkafuu:demo?theme=asoul)
![A-SOUL](https://count.dsrkafuu.net/dsrkafuu:demo?theme=asoul&length=10)
**Moebooru**
**Moebooru (with `theme=moebooru&length=auto`)**
![Moebooru](https://count.dsrkafuu.net/dsrkafuu:demo?theme=moebooru)
![Moebooru](https://count.dsrkafuu.net/dsrkafuu:demo?theme=moebooru&length=auto)
##### Rule 34
**Rule 34 (with `theme=rule34`)**
![Rule 34](https://count.dsrkafuu.net/dsrkafuu:demo?theme=rule34)
##### Gelbooru
![Gelbooru](https://count.dsrkafuu.net/dsrkafuu:demo?theme=gelbooru)
</details>
## Usage
@ -34,46 +30,45 @@ Fork of Moe Counter for fast global access powered by Cloudflare Workers.
**Public Counter**
```
https://count.dsrkafuu.net/<id>
https://count.dsrkafuu.net/<id>?theme=<theme>&length=<length>
https://count.dsrkafuu.net/dsrkafuu:demo?theme=gelbooru
https://count.dsrkafuu.net/{id}
https://count.dsrkafuu.net/{id}?theme={asoul,gelbooru,moebooru,rule34}&length={1-10,auto}
```
1. `<id>`: Any string between 1-256 chars (`a-z0-9:.@_-` allowed)
2. `<theme>`: `asoul`, `gelbooru`, `moebooru`, `rule34` (and two other themes, default: `gelbooru`)
3. `<length>`: Number between 1-10 (default: 7) or `auto`
1. ID: Any custom string between 1-256 chars (`a-zA-Z0-9:.@_-` allowed)
2. Themes: `asoul`, `gelbooru`, `moebooru`, `rule34` and two other themes (default: `gelbooru`)
3. Length: Number between `1-10` (default: `7`) or string `auto`
Recommend to use `user:usage` like string as ID for better management.
Recommend to use `user:usage` like string as ID for better management and potential issue tracking.
**API Endpoints**
```
GET https://count.dsrkafuu.net/api/<id>
DELETE https://count.dsrkafuu.net/api/<id>
GET https://count.dsrkafuu.net/api/{id}
DELETE https://count.dsrkafuu.net/api/{id}
```
DELETE is not enabled by default, create a issue if you need to use it in public counter.
DELETE is not enabled in public counter, create a issue if you need to use it.
**HTML and Markdown**
```
<img src="https://count.dsrkafuu.net/<id>" alt="<id>" />
![<id>](https://count.dsrkafuu.net/<id>)
<img src="https://count.dsrkafuu.net/{id}" alt="{id}" />
![{id}](https://count.dsrkafuu.net/{id})
```
## Self-hosting
1. Create a Cloudflare Workers worker
2. Create a Cloudflare Workers KV store
3. Create your own `wrangler.toml` based on the example
3. Create your own `wrangler.toml` based on the `wrangler.example.toml`
4. Build the worker and publish it using `wrangler publish`
## Credits
- [A-SOUL](https://space.bilibili.com/703007996)
- [Moebooru](https://github.com/moebooru/moebooru)
- [Rule 34 (**NSFW**)](https://rule34.xxx/)
- [Gelbooru (**NSFW**)](https://gelbooru.com/)
- [Rule 34 **(❗NSFW❗)**](https://rule34.xxx/)
- [Gelbooru **(❗NSFW❗)**](https://gelbooru.com/)
## License