animality.rs

A simple API wrapper that generates images & facts of any animal

Installation

toml [dependencies] tokio = { version = "1", features = ["full"] } animality = { version = "0.1.0" }

Example

We use Tokio to help with the asynchronous runtime for Rust.

```rust async fn main() -> Result<(), Box> { let animality = Animality::new("APIKEY"); let result = animality.fetchrandomimage(String::from("dolphin")).await?; let result2 = animality.fetch_fact(String::from("cat")).await?;

println!("{}", result.link);
println!("{}", result2.fact);

Ok(());

} ```

This outputs the following text in the terminal:

json { "link": "https://api.animality.xyz/images/capybara/20.png", "fact": "Capybaras can make for good pets when kept in groups." }