reddit

package
v0.0.0-...-bf5f488 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 14, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	RedditClient *reddit.Bot
}

Client struct to hold the reddit client

func NewClient

func NewClient(username, password, clientID, clientSecret, userAgent string) *Client

NewClient returns a new reddit client

func (*Client) DeletePost

func (c *Client) DeletePost(postID string) error

DeletePost deletes a post on subreddit

func (*Client) FetchLatestPostWithHighestLikes

func (c *Client) FetchLatestPostWithHighestLikes(subreddit string) (*reddit.Post, error)

FetchLatestPostWithHighestLikes fetch latest post in subreddit sorted by highest likes

func (*Client) ListHotPosts

func (c *Client) ListHotPosts(subreddit string) ([]*reddit.Post, error)

ListHotPosts lists hot posts on subreddit

func (*Client) ListSubreddit

func (c *Client) ListSubreddit(subreddit string) ([]*reddit.Post, error)

ListSubreddit lists the subreddit by name

func (*Client) MoveDown

func (c *Client) MoveDown(postID string) error

MoveDown a post in subreddit

func (*Client) MoveUp

func (c *Client) MoveUp(postID string) error

MoveUp a post in subreddit

func (*Client) SubmitPost

func (c *Client) SubmitPost(subreddit, title, body string) (*reddit.Post, error)

SubmitPost submit a post to subreddit

func (*Client) UpdatePost

func (c *Client) UpdatePost(postID, newTitle, newText string) (*reddit.Post, error)

UpdatePost updates a post on subreddit

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL