oauth

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const CommentApiPoint = "https://api.reddit.com/api/info/?id=t1_"

CommentApiPoint is the endpoint format which we should get info about comments

View Source
const PostApiPoint = "https://api.reddit.com/api/info/?id=t3_"

PostApiPoint is the endpoint format which we should get info about posts

View Source
const UserAgent = "TelegramBot:Reddit-Downloader-Bot:" + config.Version + " (by /u/HirbodBehnam)"

UserAgent of requests

Variables

View Source
var RateLimitError = errors.New("rate limit reached")

Functions

This section is empty.

Types

type RedditOauth

type RedditOauth struct {
	// contains filtered or unexported fields
}

RedditOauth is an struct which can talk to reddit endpoints

func NewRedditOauth

func NewRedditOauth(clientId, clientSecret string) (*RedditOauth, error)

NewRedditOauth returns a new RedditOauth to be used to get posts from reddit

func (*RedditOauth) GetComment

func (r *RedditOauth) GetComment(id string) (map[string]interface{}, error)

GetComment gets the info about a comment from reddit

func (*RedditOauth) GetPost

func (r *RedditOauth) GetPost(id string) (map[string]interface{}, error)

GetPost gets the info about a post from reddit

Jump to

Keyboard shortcuts

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