gomemes

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2022 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Subreddits = []string{
	"funny",
	"memes",
	"meirl",
	"valorantmemes",
	"dankmemes",
	"wholesomememes",
	"okbuddyretard",
	"comedymemes",
	"pewdiepiesubmissions",
	"lastimages",
	"historymemes",
	"raimimemes",
	"Overwatch_Memes",
}
View Source
var (
	Version = "0.0.1"
)

Functions

This section is empty.

Types

type Meme

type Meme struct {
	ID         string  `json:"id"`
	Subreddit  string  `json:"subreddit"`
	Title      string  `json:"title"`
	Author     string  `json:"author"`
	Image      string  `json:"image"`
	Ups        int     `json:"ups"`
	Downs      int     `json:"downs"`
	Score      int     `json:"score"`
	Comments   int     `json:"comments"`
	NSFW       bool    `json:"nsfw"`
	CreatedUTC float64 `json:"createdUtc"`
}

Meme

func GetRandomMeme

func GetRandomMeme() (*Meme, error)

GetRandomMeme retrieve a random meme from a random subreddit

func GetRandomMemeFromSubreddit

func GetRandomMemeFromSubreddit(subreddit string) (*Meme, error)

GetRandomMemeFromSubreddit retrieve a random meme from the given subreddit

type PostData

type PostData struct {
	ID             string  `json:"id"`
	Subreddit      string  `json:"subreddit"`
	AuthorFullname string  `json:"author_fullname"`
	Title          string  `json:"title"`
	Downs          int     `json:"downs"`
	Ups            int     `json:"ups"`
	Score          int     `json:"score"`
	Over18         bool    `json:"over_18"`
	Permaling      string  `json:"permalink"`
	Url            string  `json:"url"`
	Comments       int     `json:"num_comments"`
	CreatedUTC     float64 `json:"created_utc"`
}

type Posts

type Posts struct {
	Kind string `json:"kind"`
	Data struct {
		Children []struct {
			Kind string   `json:"kind"`
			Data PostData `json:"data"`
		} `json:"children"`
	} `json:"data"`
}

Jump to

Keyboard shortcuts

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