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

#1888 in Web programming

Download history 9/week @ 2024-01-08 9/week @ 2024-02-19 35/week @ 2024-02-26 2/week @ 2024-03-11 9/week @ 2024-04-01 138/week @ 2024-04-08 21/week @ 2024-04-15 12/week @ 2024-04-22

180 downloads per month

MIT/Apache

22KB
496 lines

ci-badge crates.io version

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–21MB
~295K SLoC