Нема описа

crptmem c081a4e7b5 minor: remove println пре 7 месеци
.github f6d930473f add tests to workflow пре 7 месеци
src c081a4e7b5 minor: remove println пре 7 месеци
.gitignore 8819b47463 initial commit пре 7 месеци
Cargo.lock c081a4e7b5 minor: remove println пре 7 месеци
Cargo.toml c081a4e7b5 minor: remove println пре 7 месеци
LICENSE 2b9555a19b license пре 7 месеци
README.md 858d2bc7d7 fix: auth example in readme пре 7 месеци

README.md

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