mirror of
https://github.com/filvyb/nimbooru
synced 2026-01-11 19:31:39 +00:00
No description
| src | ||
| tests | ||
| .gitignore | ||
| example.nim | ||
| LICENSE | ||
| nimbooru.nimble | ||
| README.md | ||
Nimbooru
A Nim library for searching and retrieving posts from multiple boorus.
Supported Sites
Gelbooru, Safebooru, Danbooru, Yandere, Konachan, E621, Sankaku, IdolComplex, Zerochan, Rule34Paheal
Installation
nimble install nimbooru
Usage
import nimbooru
import std/options
var client = initBooruClient(Safebooru)
# Search posts
let posts = client.searchPosts(limit = 20)
for post in posts:
echo post.file_url
# Search with tags
let filtered = client.searchPosts(
tags = some @["green eyes"],
exclude_tags = some @["hat"]
)
# Get single post
let post = client.getPost("12345")
Async
import std/asyncdispatch
let posts = waitFor client.asyncSearchPosts(limit = 50)
let post = waitFor client.asyncGetPost("12345")
Authentication
var client = initBooruClient(
Gelbooru,
apiKey = some "key",
userId = some "id"
)
Custom URL
var client = initBooruClient(
"https://safebooru.donmai.us/",
Danbooru
)
License
LGPL-3.0-or-later