Giter Club home page Giter Club logo

roux's Introduction

Roux

Build Documentation Crate GitHub

Roux is a simple, asynchronous 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: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();
me.submit_link("LINK_TITLE", "LINK", "SUBREDDIT");

Read-Only Modules

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

Features

  • (Default) tokio_new - use tokio 1.1.0 based reqwest.
  • tokio_back_compat - use tokio 0.2 based reqwest.

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).

roux's People

Contributors

akarras avatar beanpuppy avatar buggstream avatar cppxor2arr avatar ddemarco5 avatar deltamaniac avatar dependabot[bot] avatar frogtd avatar harababurel avatar hyde46 avatar kibouo avatar lironhl avatar scratchyone avatar spikecodes avatar torfsen avatar vikigenius avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.