aghpb 1.3.2

Anime girls holding programming books API wrapper for ๐Ÿฆ€Rust.
Documentation

๐Ÿฆ€ aghpb.rs ๐Ÿ“š

Rust API wrapper for the anime girls holding programming books API

Crates.io docs.rs

Note

This is part of my aghpb api wrapper challenge where I attempt to write an api wrapper in every language possible. So yes expect spaghetti code as it will be my first time writing in these languages. Although I'm 100% open to improvements and corrections so feel free to contribute anything. Other languages I've done

Install

cargo add aghpb

More install instructions at crates.io.

Examples

This is how you may retrieve a random anime girls holding programming books:

use std::error::Error;

#[tokio::main]
async fn main() -> Result<(), Box<dyn Error>> {
    let book = aghpb::random(None).await?;

    println!("Name: {}", book.name);
    println!("Category: {}", book.category);
    println!("Date added: {}", book.date_added);

    fs::write("./anime_girl.png", book.raw_bytes).await?;

    Ok(())
}

You can also retrieve specific categories of anime girls holding programming books like so:

let book = aghpb::random(Some("rust")).await?;

This is how you may retrieve a list of available categories:

use std::error::Error;

#[tokio::main]
async fn main() -> Result<(), Box<dyn Error>> {
    let categories = aghpb::categories().await?;

    for category in categories {
        println!("{}", category);
    }

    Ok(())
}

Made using my API at ๐Ÿ‘‰ https://api.devgoldy.xyz/aghpb/v1/