Struct orca::App [] [src]

pub struct App {
    pub conn: Connection,
}

A reddit object

Usage:

To create a new instance, use Reddit::new()

Fields

Methods

impl App
[src]

[src]

Create a new reddit instance

Arguments

  • appname - Unique app name
  • appversion - App version
  • appauthor - Auther of the app # Returns A new reddit object

[src]

Return an Auth object for use with API calls that require a user account to work

Arguments

  • username - Username of the user to be authorized as
  • password - Password of the user to be authorized as
  • oauth - Oauth app type # Returns A result containing either an Auth object or a certain error To use place it in the auth field of a connection struct

[src]

Get the posts in a subreddit sorted in a specific way

Arguments

  • sub - Name of subreddit to query
  • sort - Sort method of query # Returns A result containing a json listing of posts

[src]

Submit a self post

Arguments

  • sub - Name of the subreddit to submit a post to
  • title - Title of the post
  • text - Body of the post # Returns A result with reddit's json response to the submission

[src]

Get info of the user currently authorized

Note: requires connection to be authorized

Returns

A result with the json value of the user data

[src]

[src]

Get a iterator of all comments in order of being posted

Arguments

  • sub - Name of the subreddit to pull comments from. Can be 'all' to pull from all of reddit

[src]

Loads the comment tree of a post, returning a listing of the Comment enum, which can be either Loaded or NotLoaded

Arguments

  • post - The name of the post to retrieve the tree from

[src]

Load more comments

[src]

Comment on a thing

Arguments

  • text - The body of the comment
  • thing - Fullname of the thing to comment on

[src]

Sticky a post in a subreddit

Arguments

  • sticky - boolean value. True to set post as sticky, false to unset post as sticky
  • slot - Optional slot number to fill (1 or 2)
  • id - fullname of the post to sticky

[src]

Load a thing

[src]