Crate roux

Source
Expand description

§roux.rs

This crate provides simple access to the Reddit API.

§Using OAuth

To create an OAuth client with the reddit API, use the Reddit class.

use roux::Reddit;

let client = Reddit::new("USER_AGENT", "CLIENT_ID", "CLIENT_SECRET")
    .username("USERNAME")
    .password("PASSWORD")
    .login()
    .await;
let me = client.unwrap();

It is important that you pick a good user agent. The ideal format is platform:program:version (by /u/yourname), e.g. macos:roux:v0.3.0 (by /u/beanpup_py).

This will authticate you as the user given in the username function.

§Usage

Using the OAuth client, you can:

§Submit A Text Post

use roux::Reddit;

let client = Reddit::new("USER_AGENT", "CLIENT_ID", "CLIENT_SECRET")
    .username("USERNAME")
    .password("PASSWORD")
    .login()
    .await;
let me = client.unwrap();

me.submit_text("TEXT_TITLE", "TEXT_BODY", "SUBREDDIT");

§Submit A Link Post

use roux::Reddit;

let client = Reddit::new("USER_AGENT", "CLIENT_ID", "CLIENT_SECRET")
    .username("USERNAME")
    .password("PASSWORD")
    .login()
    .await;
let me = client.unwrap();

Modules§

about
User Overview Responses
comment
Subreddit Comment Responses
friend
Inbox Responses
inbox
Inbox Responses
me
Me
moderator
Subreddit Moderator Responses
overview
User Overview Responses
reply
Subreddit Comment Responses
response
Responses
saved
Me Responses
submission
Subreddit Submission Responses
subreddit
Subreddit
user
User
util
Utils for requests.

Structs§

Friend
The response from an add friend request
Me
Me
Reddit
Client to use OAuth with Reddit.
Subreddit
Subreddit
Subreddits
Access subreddits API
User
User.

Enums§

MaybeReplies
Replies can be more comments or an empty string

Type Aliases§

About
Overview
Comments
SubredditComments
Inbox
Inbox
Moderators
Moderators
Overview
Overview
Replies
Doc
Saved
Saved listing
Submissions
Submissions