All Projects → halcyonnouveau → roux

halcyonnouveau / roux

Licence: MIT license
Simple and (a)synchronous Reddit API wrapper for Rust.

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to roux

Psraw
PowerShell Reddit API Wrapper
Stars: ✭ 42 (+2.44%)
Mutual labels:  reddit, reddit-api, api-wrapper
Snoo
A Reddit command line client written in Node.js, using modern ES-features
Stars: ✭ 39 (-4.88%)
Mutual labels:  reddit, reddit-api
Redditbot
Discord bot for reddit.com
Stars: ✭ 17 (-58.54%)
Mutual labels:  reddit, reddit-api
Reddit Bot
🤖 Making a Reddit Bot using Python, Heroku and Heroku Postgres.
Stars: ✭ 99 (+141.46%)
Mutual labels:  reddit, reddit-api
Jraw
The Java Reddit API Wrapper
Stars: ✭ 320 (+680.49%)
Mutual labels:  reddit, reddit-api
Social Amnesia
Forget the past. Social Amnesia makes sure your social media accounts only show your posts from recent history, not from "that phase" 5 years ago.
Stars: ✭ 656 (+1500%)
Mutual labels:  reddit, reddit-api
Reddsaver
CLI tool to download saved and upvoted media from Reddit
Stars: ✭ 76 (+85.37%)
Mutual labels:  reddit, reddit-api
set-top-reddit-wallpaper
PowerShell script to set the wallpaper as the top post of the day/week/month from /r/wallpapers and /r/wallpaper or any other subreddits.
Stars: ✭ 17 (-58.54%)
Mutual labels:  reddit, reddit-api
Redd
Redd is a batteries-included API wrapper for reddit.
Stars: ✭ 180 (+339.02%)
Mutual labels:  reddit, api-wrapper
Unim.press
A Reddit front-page reader in the style of The New York Times.
Stars: ✭ 199 (+385.37%)
Mutual labels:  reddit, reddit-api
Praw
PRAW, an acronym for "Python Reddit API Wrapper", is a python package that allows for simple access to Reddit's API.
Stars: ✭ 2,675 (+6424.39%)
Mutual labels:  reddit, reddit-api
reddit-comment-bot
Reddit bot that auto replies to comments on set subreddits
Stars: ✭ 59 (+43.9%)
Mutual labels:  reddit, reddit-api
ARAW
The Android Reddit API Wrapper
Stars: ✭ 75 (+82.93%)
Mutual labels:  reddit, reddit-api
Shreddit
Remove your comment history on Reddit as deleting an account does not do so.
Stars: ✭ 669 (+1531.71%)
Mutual labels:  reddit, reddit-api
Mongit
💾 Mongo-esque Reddit-based Database!
Stars: ✭ 20 (-51.22%)
Mutual labels:  reddit, reddit-api
node-express-reddit-clone
Build a Node, Express and MySQL-based clone of Reddit for DecodeMTL web development bootcamp
Stars: ✭ 28 (-31.71%)
Mutual labels:  reddit, reddit-api
rreddit
𝐫⟋ Get Reddit data
Stars: ✭ 49 (+19.51%)
Mutual labels:  reddit, reddit-api
redditwatcher
📻 Reddit streaming CLI
Stars: ✭ 17 (-58.54%)
Mutual labels:  reddit, reddit-api
Mvvm Reddit
A companion project for our blog post on better Android software development using MVVM with RxJava.
Stars: ✭ 106 (+158.54%)
Mutual labels:  reddit, reddit-api
crypto-subreddits-cli
👽 Track Cryptocurrency Subreddits On The Command Line 👽
Stars: ✭ 24 (-41.46%)
Mutual labels:  reddit, reddit-api

Roux

Build Documentation Crate GitHub

Roux is a simple, (a)synchronous Reddit API wrapper implemented in Rust.

Usage

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:v2.0.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").await?;

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();
me.submit_link("LINK_TITLE", "LINK", "SUBREDDIT").await?;

Read-Only Modules

There are also read-only modules that don't need authentication:

Blocking Client

You can use a blocking (synchronous) API instead of tokio by enabling the blocking feature.

[dependencies]
roux = { version = "2", features = ["blocking"] }
use roux::Reddit;
let client = Reddit::new("USER_AGENT", "CLIENT_ID", "CLIENT_SECRET")
    .username("USERNAME")
    .password("PASSWORD")
    .login();

let me = client.unwrap();
me.submit_link("LINK_TITLE", "LINK", "SUBREDDIT");

3rd-Party Libraries

  • roux-stream provides an API for continuously streaming new submissions and comments

Contributing

Roux is not in active development but is still being maintained and currently covers the most common and useful endpoints. If you see something missing or encounter a bug, feel free to open an issue or create a pull request.

License

Roux is licensed under the MIT license (see LICENSE file).

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].