Skip to content
This repository has been archived by the owner on Jun 29, 2022. It is now read-only.
/ redbot Public archive

Reddit API bindings in Rust

License

Notifications You must be signed in to change notification settings

Celeo/redbot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

redbot

(Unofficial) Rust bindings for Reddit's API.

crates.io link

Reddit's API documentation can be found here and endpoint documentation can be found here.

Usage

Example

use redbot::{Api, Config, Value};

fn main() {
    let config = Config::load_config("config.json").expect("Could not load confiog");
    let mut api = Api::new(config);
    api.do_login().expect("Could not perform login");

    let mut resp = match api.query("GET", "api/v1/me/karma", None, None) {
        Ok(resp) => resp,
        Err(err) => panic!(err),
    };
    let karma_breakdown: Value = match resp.json() {
        Ok(data) => data,
        Err(err) => panic!(err),
    };

    println!("{:?}", karma_breakdown);
}

About

Reddit API bindings in Rust

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages