Crates.io | joketeller |
lib.rs | joketeller |
version | 0.2.1 |
source | src |
created_at | 2022-06-06 18:51:51.399951 |
updated_at | 2022-06-08 13:32:15.843106 |
description | Simple API client for sv443's jokeapi |
homepage | https://github.com/canarado/joketeller |
repository | https://github.com/canarado/joketeller |
max_upload_size | |
id | 600909 |
size | 22,087 |
Current Version: 0.2.1
[dependencies]
joketeller = "0.2.1"
View the Sv443 API here.
This crate is in active development, there is full support for getting jokes, but all other API features are being added with time.
use joketeller::{
Joker, Category, BlacklistFlag,
}
let mut joker_instance: Joker = Joker::new();
// Chainable API
joker_instance
.add_categories(&mut vec![Category::Programming, Category::Pun])
.add_blacklist_flags(&mut vec![BlacklistFlag::Explicit]);
// get JSON joke
let joke = joker_instance.get_joke().unwrap();
// get https url to make your own request
let built_api_url = joker_instance.build_url().unwrap();
The docs are always being updated, current docs can be found here.