13 releases
0.2.8 | Apr 13, 2024 |
---|---|
0.2.7 | Jan 9, 2024 |
0.2.6 | May 31, 2023 |
0.2.5 | Jan 19, 2023 |
0.1.3 | Nov 22, 2022 |
#733 in Web programming
694 downloads per month
22KB
496 lines
booru-rs
An async Booru client for Rust
Overview
The client currently supports:
- Gelbooru
- Safebooru
- Danbooru
- Konachan
- R34
- 3DBooru
- More... ?
Example
Remember to bring the Client
trait into scope with use booru_rs::client::Client;
let posts = GelbooruClient::builder()
.tag("kafuu_chino")
.tag("2girls")
.rating(GelbooruRating::General)
.sort(GelbooruSort::Score)
.limit(5)
.random(true)
.blacklist_tag(GelbooruRating::Explicit)
.build()
.get()
.await
.expect("There was an error retrieving posts from the API");
lib.rs
:
Usage
use booru_rs::{danbooru::{DanbooruClient, DanbooruRating}, Sort, Client};
#[tokio::main]
async fn main() {
let posts = DanbooruClient::builder()
.rating(DanbooruRating::General)
.sort(Sort::Score)
.build()
.get()
.await
.expect("There was an error. (•-•)");
match posts.first() {
Some(post) => println!("{:?}", post),
None => panic!("Well... \"No posts found?\""),
}
}
Dependencies
~6–18MB
~258K SLoC