Coder Social home page Coder Social logo

orca's Introduction

orca

A simple reddit API interface for Rust

Features Implemented:

  • Comment streams from entire subreddits
  • Comment tree traversing
  • Oauth script authorization
  • Oauth installed app authorization
  • Self post submissions
  • User info
  • Comment data structure
  • Listing data structure
  • Comment submissions
  • Automatic ratelimiting (steady and burst)
  • Failure for error handling

Features Todo (nonexhaustive):

  • All data structures, or maybe pure json. Consistency is the goal.
  • More reddit api implementation
  • More complete error handling

Contributing

If you've ever made a pull request on github before, you probably know more about it than me. I would really appreciate any help on this project, so if you have an idea on how to improve it, please feel free to submit an issue or pull request.

Example: Recursively traversing a comment tree

fn print_tree(listing: Listing<Comment>, level: i32) {
	for comment in listing {
	    for _ in 0..level {
		    print!("\t");
		}
		println!("Comment by {}", comment.author);
		print_tree(comment.replies, level + 1);
	}
}

print_tree(tree, 0);

Example: Authorizing as OAuth Script type

let mut app = App::new("appnamehere", "v0.1.0", "/u/usernamehere/").unwrap();
app.authorize_script(id, secret, username, password).unwrap();

In order to send HTTPS requests, this library depends on openssl-sys, which requires openssl development libraries to be installed on your system to build the project. Instructions detailing this process can be found here

Generic Notice: This is an unstable project yadda yadda yadda use it if you dare thanks

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.