boosty-rs

Crates.ioboosty-rs
lib.rsboosty-rs
version1.0.0
sourcesrc
created_at2024-02-23 09:30:35.787503
updated_at2024-07-03 10:37:56.252013
descriptionA Rust library for Boosty closed API
homepage
repositoryhttps://github.com/crptmem/boosty-rs
max_upload_size
id1150392
size13,477
corruptmemory (crptmem)

documentation

README

boosty-rs

A Rust library for Boosty closed API Rust

Installation

$ cargo add boosty-rs

Examples

Fetch all posts from blog

use std::error::Error;
use boosty_rs::request;

#[tokio::main]
async fn main() -> Result<(), Box<dyn Error>> {
    let response = request::fetch_posts("boosty".to_string(), None).await?;
    println!("{:?}", response); 
    Ok(())
}

Fetch one post from blog

use std::error::Error;
use boosty_rs::request;

#[tokio::main]
async fn main() -> Result<(), Box<dyn Error>> {
    let response = request::fetch_post("boosty".to_string(), "a4dc61c8-4ff9-495b-946b-3982efef68fe".to_string(), None).await?;
    println!("{:?}", response); 
    Ok(())
}

Fetch all posts from blog with authorization

use std::error::Error;
use boosty_rs::request;
use boosty_rs::auth::Auth;

#[tokio::main]
async fn main() -> Result<(), Box<dyn Error>> {
    let response = request::fetch_posts("boosty".to_string(), Auth::new("access_token".to_string())).await?;
    println!("{:?}", response); 
    Ok(())
}
Commit count: 53

cargo fmt