#post #api #closed #error #request #fetch #boosty

boosty-rs

A Rust library for Boosty closed API

11 releases

0.1.12 Apr 10, 2024
0.1.11 Feb 23, 2024

#862 in Web programming

Download history 394/week @ 2024-02-18 116/week @ 2024-02-25 14/week @ 2024-03-03 4/week @ 2024-03-10 9/week @ 2024-03-31 122/week @ 2024-04-07 10/week @ 2024-04-14

141 downloads per month

MIT license

11KB
142 lines

boosty-rs

A Rust library for Boosty closed API

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(())
}

Dependencies

~9–24MB
~358K SLoC