reddit

package
v2.49.0 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: MIT, MIT Imports: 14 Imported by: 1

README

go-reddit

Build Status GoDoc Go Report Card

A Golang wrapper for the Reddit API. This package aims to implement every endpoint exposed according to the documentation in a user friendly, well tested and documented manner.

Installation

Install the package with

go get github.com/cameronstanley/go-reddit

Authentication

Many endpoints in the Reddit API require OAuth2 authentication to access. To get started, register an app at https://www.reddit.com/prefs/apps and be sure to note the ID, secret, and redirect URI. These values will be used to construct the Authenticator to generate a client with OAuth access. The following is an example of creating an authenticated client using a manual approach:

package main

import(
  "fmt"
  "github.com/cameronstanley/go-reddit"
)

func main() {
  // Create a new authenticator with your app's client ID, secret, and redirect URI
  // A random string representing state and a list of requested OAuth scopes are required
  authenticator := reddit.NewAuthenticator("<user-agent>", "<client_id>", "<client_secret>", "<redirect_uri>", "<random_string>", reddit.ScopeIdentity)
  
  // Instruct your user to visit the URL retrieved from GetAuthenticationURL in their web browser
  url := authenticator.GetAuthenticationURL()
  fmt.Printf("Please proceed to %s\n", url)

  // After the user grants permission for your client, they will be redirected to the supplied redirect_uri with a code and state as URL parameters
  // Gather these values from the user on the console
  // Note: this can be automated by having a web server listen on the redirect_uri and parsing the state and code params
  fmt.Print("Enter state: ")
  var state string
  fmt.Scanln(&state)

  fmt.Print("Enter code: ")
  var code string
  fmt.Scanln(&code)

  // Exchange the code for an access token
  token, err := authenticator.GetToken(state, code)
  
  // Create a new client using the access token and a user agent string to identify your application
  client := authenticator.GetAuthClient(token, "<platform>:<app ID>:<version string> (by /u/<reddit username>)")
}

Examples

// Returns a new unauthenticated client for invoking the API
client := reddit.NoAuthClient

// Retrives a listing of default subreddits
client.GetDefaultSubreddits()

// Retrives a listing of hot links for the "news" subreddit
client.GetHotLinks("news")

Documentation

Overview

Package reddit provides Reddit API wrapper utilities.

Index

Constants

View Source
const (
	// ScopeIdentity allows access to account information.
	ScopeIdentity = "identity"
	// ScopeEdit allows modification and deletion of comments and submissions.
	ScopeEdit = "edit"
	// ScopeFlair allows modification of user link flair on submissions.
	ScopeFlair = "flair"
	// ScopeHistory allows access to user voting history on comments and submissions
	ScopeHistory = "history"
	// ScopeModConfig allows management of configuration, sidebar, and CSS of user managed subreddits.
	ScopeModConfig = "modconfig"
	// ScopeModFlair allows management and assignment of user moderated subreddits.
	ScopeModFlair = "modflair"
	// ScopeModLog allows access to moderation log for user moderated subreddits.
	ScopeModLog = "modlog"
	// ScopeModWiki allows changing of editors and visibility of wiki pages in user moderated subreddits.
	ScopeModWiki = "modwiki"
	// ScopeMySubreddits allows access to the list of subreddits user moderates, contributes to, and is subscribed to.
	ScopeMySubreddits = "mysubreddits"
	// ScopePrivateMessages allows access to user inbox and the sending of private messages to other users.
	ScopePrivateMessages = "privatemessages"
	// ScopeRead allows access to user posts and comments.
	ScopeRead = "read"
	// ScopeReport allows reporting of content for rules violations.
	ScopeReport = "report"
	// ScopeSave allows saving and unsaving of user comments and submissions.
	ScopeSave = "save"
	// ScopeSubmit allows user submission of links and comments.
	ScopeSubmit = "submit"
	// ScopeSubscribe allows management of user subreddit subscriptions and friends.
	ScopeSubscribe = "subscribe"
	// ScopeVote allows user submission and changing of votes on comments and submissions.
	ScopeVote = "vote"
	// ScopeWikiEdit allows user editing of wiki pages.
	ScopeWikiEdit = "wikiedit"
	// ScopeWikiRead allow user viewing of wiki pages.
	ScopeWikiRead = "wikiread"
)

Variables

View Source
var NoAuthClient = &Client{
	http: new(http.Client),
}

NoAuthClient is the unauthenticated client for interacting with the Reddit API.

Functions

func NewError

func NewError(resp *http.Response) error

Types

type Account

type Account struct {
	CommentKarma int     `json:"comment_karma"`
	Created      float32 `json:"created"`
	CreatedUtc   float32 `json:"created_utc"`
	Features     struct {
		ActivityServiceRead    bool `json:"activity_service_read"`
		ActivityServiceWrite   bool `json:"activity_service_write"`
		AdblockTest            bool `json:"adblock_test"`
		AdsAuction             bool `json:"ads_auction"`
		AdsAutoExtend          bool `json:"ads_auto_extend"`
		AdsAutoRefund          bool `json:"ads_auto_refund"`
		AdserverReporting      bool `json:"adserver_reporting"`
		AdzerkDoNotTrack       bool `json:"adzerk_do_not_track"`
		AdzerkReporting2       bool `json:"adzerk_reporting_2"`
		DoNotTrack             bool `json:"do_not_track"`
		EuCookiePolicy         bool `json:"eu_cookie_policy"`
		ExpandoEvents          bool `json:"expando_events"`
		ForceHTTPS             bool `json:"force_https"`
		GiveHstsGrants         bool `json:"give_hsts_grants"`
		HTTPSRedirect          bool `json:"https_redirect"`
		ImageUploads           bool `json:"image_uploads"`
		ImgurGifConversion     bool `json:"imgur_gif_conversion"`
		LegacySearchPref       bool `json:"legacy_search_pref"`
		LiveHappeningNow       bool `json:"live_happening_now"`
		MoatTracking           bool `json:"moat_tracking"`
		MobileNativeBanner     bool `json:"mobile_native_banner"`
		MobileSettings         bool `json:"mobile_settings"`
		MobileWebTargeting     bool `json:"mobile_web_targeting"`
		NewLoggedinCachePolicy bool `json:"new_loggedin_cache_policy"`
		NewReportDialog        bool `json:"new_report_dialog"`
		OrangeredsAsEmails     bool `json:"orangereds_as_emails"`
		OutboundClicktracking  bool `json:"outbound_clicktracking"`
		PauseAds               bool `json:"pause_ads"`
		PostEmbed              bool `json:"post_embed"`
		ScreenviewEvents       bool `json:"screenview_events"`
		ScrollEvents           bool `json:"scroll_events"`
		ShowNewIcons           bool `json:"show_new_icons"`
		StickyComments         bool `json:"sticky_comments"`
		SubredditRules         bool `json:"subreddit_rules"`
		Timeouts               bool `json:"timeouts"`
		UpgradeCookies         bool `json:"upgrade_cookies"`
		YoutubeScraper         bool `json:"youtube_scraper"`
	} `json:"features"`
	GoldCreddits            int    `json:"gold_creddits"`
	GoldExpiration          int    `json:"gold_expiration"`
	HasVerifiedEmail        bool   `json:"has_verified_email"`
	HideFromRobots          bool   `json:"hide_from_robots"`
	ID                      string `json:"id"`
	InBeta                  bool   `json:"in_beta"`
	InboxCount              int    `json:"inbox_count"`
	IsEmployee              bool   `json:"is_employee"`
	IsGold                  bool   `json:"is_gold"`
	IsMod                   bool   `json:"is_mod"`
	IsSuspended             bool   `json:"is_suspended"`
	LinkKarma               int    `json:"link_karma"`
	Name                    string `json:"name"`
	Over18                  bool   `json:"over_18"`
	SuspensionExpirationUtc int    `json:"suspension_expiration_utc"`
}

Account contains user account information.

type Authenticator

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

Authenticator provides functions for authenticating a user via OAuth2 and generating a client that can be used to access authorized API endpoints.

func NewAuthenticator

func NewAuthenticator(ua string, clientID string, clientSecret string, redirectURL string, state string, scopes ...string) *Authenticator

NewAuthenticator generates a new authenticator with the supplied client, state, and requested scopes.

func (*Authenticator) GetAuthClient

func (a *Authenticator) GetAuthClient(token *oauth2.Token, userAgent string) *Client

GetAuthClient generates a new authenticated client using the supplied access token.

func (*Authenticator) GetAuthenticationURL

func (a *Authenticator) GetAuthenticationURL() string

GetAuthenticationURL retrieves the URL used to direct the authenticating user to Reddit for permissions approval.

func (*Authenticator) GetToken

func (a *Authenticator) GetToken(state string, code string) (*oauth2.Token, error)

GetToken exchanges an authorization code for an access token.

type Award

type Award struct {
	AwardID     string      `json:"award_id"`
	Description interface{} `json:"description"`
	ID          string      `json:"id"`
	Icon40      string      `json:"icon_40"`
	Icon70      string      `json:"icon_70"`
	Name        string      `json:"name"`
	URL         interface{} `json:"url"`
}

type Client

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

Client is the client for interacting with the Reddit API.

func (c *Client) CommentOnLink(linkID string, text string) error

CommentOnLink posts a top-level comment to the given link. Requires the 'submit' OAuth scope.

func (*Client) DeleteComment

func (c *Client) DeleteComment(commentID string) error

DeleteComment deletes a comment submitted by the currently authenticated user. Requires the 'edit' OAuth scope.

func (c *Client) DeleteLink(linkID string) error

DeleteLink deletes a link submitted by the currently authenticated user. Requires the 'edit' OAuth scope.

func (*Client) EditCommentText

func (c *Client) EditCommentText(commentID string, text string) error

EditCommentText edits the text of a comment by the currently authenticated user. Requires the 'edit' OAuth scope.

func (*Client) EditLinkText

func (c *Client) EditLinkText(linkID string, text string) error

EditLinkText edits the text of a self post by the currently authenticated user. Requires the 'edit' OAuth scope.

func (*Client) GetDefaultSubreddits

func (c *Client) GetDefaultSubreddits() ([]*Subreddit, error)

GetDefaultSubreddits retrieves a listing of default subreddits.

func (*Client) GetGoldSubreddits

func (c *Client) GetGoldSubreddits() ([]*Subreddit, error)

GetGoldSubreddits retrieves a listing of gold subreddits.

func (c *Client) GetHotLinks(subreddit string) ([]*Link, error)

GetHotLinks retrieves a listing of hot links.

func (*Client) GetInboxMessages

func (c *Client) GetInboxMessages() ([]*Message, error)

GetInboxMessages retrieves a list of messages in the user's inbox. Requires the 'privatemessages' OAuth scope.

func (*Client) GetLinkComments

func (c *Client) GetLinkComments(linkID string) ([]*Comment, error)

GetLinkComments retrieves a listing of comments for the given link.

func (*Client) GetMe

func (c *Client) GetMe() (*Account, error)

GetMe retrieves the user account for the currently authenticated user. Requires the 'identity' OAuth scope.

func (*Client) GetMyPreferences

func (c *Client) GetMyPreferences() (*Preferences, error)

GetMyPreferences retrieves the accouunt preferences for the currently authenticated user. Requires the 'identity' OAuth scope.

func (*Client) GetMyTrophies

func (c *Client) GetMyTrophies() ([]*Award, error)

GetMyTrophies retrieves a list of awards for the currently authenticated user. Requires the 'identity' OAuth scope.

func (c *Client) GetNewLinks(subreddit, before, after string) ([]*Link, error)

GetNewLinks retrieves a listing of new links.

func (*Client) GetNewSubreddits

func (c *Client) GetNewSubreddits() ([]*Subreddit, error)

GetNewSubreddits retrieves a listing of new subreddits.

func (*Client) GetPopularSubreddits

func (c *Client) GetPopularSubreddits() ([]*Subreddit, error)

GetPopularSubreddits retrieves a listing of popular subreddits.

func (*Client) GetSentMessages

func (c *Client) GetSentMessages() ([]*Message, error)

GetSentMessages retrieves a list of messages sent by the user. Requires the 'privatemessages' OAuth scope.

func (c *Client) GetTopLinks(subreddit string) ([]*Link, error)

GetTopLinks retrieves a listing of top links.

func (*Client) GetUnreadMessages

func (c *Client) GetUnreadMessages() ([]*Message, error)

GetUnreadMessages retrieves a list of unread messages in the user's inbox. Requires the 'privatemessages' OAuth scope.

func (*Client) GetUserInfo

func (c *Client) GetUserInfo(username string) (*Account, error)

GetUserInfo retrieves user account information for the supplied username.

func (c *Client) HideLink(linkID string) error

HideLink removes the given link from the user's default view of subreddit listings. Requires the 'report' OAuth scope.

func (*Client) IsUsernameAvailable

func (c *Client) IsUsernameAvailable(username string) (bool, error)

IsUsernameAvailable determines if the supplied username is available for registration.

func (*Client) LinksInfo

func (c *Client) LinksInfo(fullnames []string) ([]*Link, error)

func (*Client) ReplyToComment

func (c *Client) ReplyToComment(commentID string, text string) error

ReplyToComment creates a reply to the given comment. Requires the 'submit' OAuth scope.

func (*Client) ReplyToMessage

func (c *Client) ReplyToMessage(messageID string, text string) error

ReplyToMessage creates a reply to a message sent to the user. Requires the 'privatemessages' OAuth scope.

func (*Client) UpdateMyPreferences

func (c *Client) UpdateMyPreferences(preferences *Preferences) (*Preferences, error)

UpdateMyPreferences updates the accouunt preferences for the currently authenticated user. Requires the 'account' OAuth scope.

type Comment

type Comment struct {
	ApprovedBy          interface{}   `json:"approved_by"`
	Archived            bool          `json:"archived"`
	Author              string        `json:"author"`
	AuthorFlairCSSClass interface{}   `json:"author_flair_css_class"`
	AuthorFlairText     interface{}   `json:"author_flair_text"`
	BannedBy            interface{}   `json:"banned_by"`
	Body                string        `json:"body"`
	BodyHTML            string        `json:"body_html"`
	Controversiality    int           `json:"controversiality"`
	Created             int           `json:"created"`
	CreatedUtc          int           `json:"created_utc"`
	Distinguished       interface{}   `json:"distinguished"`
	Downs               int           `json:"downs"`
	Edited              bool          `json:"edited"`
	Gilded              int           `json:"gilded"`
	ID                  string        `json:"id"`
	Likes               interface{}   `json:"likes"`
	LinkID              string        `json:"link_id"`
	ModReports          []interface{} `json:"mod_reports"`
	Name                string        `json:"name"`
	NumReports          interface{}   `json:"num_reports"`
	ParentID            string        `json:"parent_id"`
	RemovalReason       interface{}   `json:"removal_reason"`
	ReportReasons       interface{}   `json:"report_reasons"`
	Replies             string        `json:"replies"`
	Saved               bool          `json:"saved"`
	Score               int           `json:"score"`
	ScoreHidden         bool          `json:"score_hidden"`
	Stickied            bool          `json:"stickied"`
	Subreddit           string        `json:"subreddit"`
	SubredditID         string        `json:"subreddit_id"`
	Ups                 int           `json:"ups"`
	UserReports         []interface{} `json:"user_reports"`
}

Comment is a response to a link or another comment.

type Error

type Error struct {
	Code    int
	Status  string
	Data    string
	Headers http.Header
}

func (*Error) Error

func (e *Error) Error() string
type Link struct {
	ApprovedBy          string  `json:"approved_by"`
	Archived            bool    `json:"archived"`
	Author              string  `json:"author"`
	AuthorFlairCSSClass string  `json:"author_flair_css_class"`
	AuthorFlairText     string  `json:"author_flair_text"`
	BannedBy            string  `json:"banned_by"`
	Clicked             bool    `json:"clicked"`
	ContestMode         bool    `json:"contest_mode"`
	Created             float64 `json:"created"`
	CreatedUtc          float64 `json:"created_utc"`
	CrosspostParent     string  `json:"crosspost_parent"`
	CrosspostParentList []*Link `json:"crosspost_parent_list"`
	Distinguished       string  `json:"distinguished"`
	Domain              string  `json:"domain"`
	Downs               int     `json:"downs"`
	// This can be a bool or a timestamp apperentely, what the fuck
	Edited            interface{}   `json:"edited"`
	Gilded            int           `json:"gilded"`
	Hidden            bool          `json:"hidden"`
	HideScore         bool          `json:"hide_score"`
	ID                string        `json:"id"`
	IsSelf            bool          `json:"is_self"`
	Likes             bool          `json:"likes"`
	LinkFlairCSSClass string        `json:"link_flair_css_class"`
	LinkFlairText     string        `json:"link_flair_text"`
	Locked            bool          `json:"locked"`
	Media             Media         `json:"media"`
	MediaEmbed        interface{}   `json:"media_embed"`
	ModReports        []interface{} `json:"mod_reports"`
	Name              string        `json:"name"`
	NumComments       int           `json:"num_comments"`
	NumReports        int           `json:"num_reports"`
	Over18            bool          `json:"over_18"`
	Permalink         string        `json:"permalink"`
	PostHint          string        `json:"post_hint"`
	Quarantine        bool          `json:"quarantine"`
	RemovalReason     interface{}   `json:"removal_reason"`
	ReportReasons     []interface{} `json:"report_reasons"`
	Saved             bool          `json:"saved"`
	Score             int           `json:"score"`
	SecureMedia       interface{}   `json:"secure_media"`
	SecureMediaEmbed  interface{}   `json:"secure_media_embed"`
	SelftextHTML      string        `json:"selftext_html"`
	Selftext          string        `json:"selftext"`
	Stickied          bool          `json:"stickied"`
	Subreddit         string        `json:"subreddit"`
	SubredditID       string        `json:"subreddit_id"`
	SuggestedSort     string        `json:"suggested_sort"`
	Thumbnail         string        `json:"thumbnail"`
	Title             string        `json:"title"`
	URL               string        `json:"url"`
	Ups               int           `json:"ups"`
	UserReports       []interface{} `json:"user_reports"`
	Visited           bool          `json:"visited"`
	IsRobotIndexable  bool          `json:"is_robot_indexable"`
	Spoiler           bool          `json:"spoiler"`
}

Link contains information about a link.

type Media

type Media struct {
	Oembed Oembed `json:"oembed"`
	Type   string `json:"type"`
}

Media is a media content item.

type Message

type Message struct {
	Author           string      `json:"author"`
	Body             string      `json:"body"`
	BodyHTML         string      `json:"body_html"`
	Context          string      `json:"context"`
	Created          int         `json:"created"`
	CreatedUtc       int         `json:"created_utc"`
	Dest             string      `json:"dest"`
	Distinguished    string      `json:"distinguished"`
	FirstMessage     interface{} `json:"first_message"`
	FirstMessageName interface{} `json:"first_message_name"`
	ID               string      `json:"id"`
	Name             string      `json:"name"`
	New              bool        `json:"new"`
	ParentID         interface{} `json:"parent_id"`
	Replies          string      `json:"replies"`
	Subject          string      `json:"subject"`
	Subreddit        interface{} `json:"subreddit"`
	WasComment       bool        `json:"was_comment"`
}

Message is a private message between users.

type Oembed

type Oembed struct {
	Description     string `json:"description"`
	HTML            string `json:"html"`
	Height          int    `json:"height"`
	ProviderName    string `json:"provider_name"`
	ProviderURL     string `json:"provider_url"`
	ThumbnailHeight int    `json:"thumbnail_height"`
	ThumbnailURL    string `json:"thumbnail_url"`
	ThumbnailWidth  int    `json:"thumbnail_width"`
	Title           string `json:"title"`
	Type            string `json:"type"`
	Version         string `json:"version"`
	Width           int    `json:"width"`
}

Oembed contains embedding information for a media item.

type Preferences

type Preferences struct {
	AffiliateLinks         bool        `json:"affiliate_links"`
	AllowClicktracking     bool        `json:"allow_clicktracking"`
	Beta                   bool        `json:"beta"`
	Clickgadget            bool        `json:"clickgadget"`
	CollapseLeftBar        bool        `json:"collapse_left_bar"`
	Compress               bool        `json:"compress"`
	CollapseReadMessages   bool        `json:"collapse_read_messages"`
	ContentLangs           []string    `json:"content_langs"`
	CredditAutorenew       bool        `json:"creddit_autorenew"`
	DefaultCommentSort     string      `json:"default_comment_sort"`
	DefaultThemeSr         interface{} `json:"default_theme_sr"`
	DomainDetails          bool        `json:"domain_details"`
	EmailMessages          bool        `json:"email_messages"`
	EnableDefaultThemes    bool        `json:"enable_default_themes"`
	ForceHTTPS             bool        `json:"force_https"`
	HideAds                bool        `json:"hide_ads"`
	HideDowns              bool        `json:"hide_downs"`
	HideFromRobots         bool        `json:"hide_from_robots"`
	HideLocationbar        bool        `json:"hide_locationbar"`
	HideUps                bool        `json:"hide_ups"`
	HighlightControversial bool        `json:"highlight_controversial"`
	HighlightNewComments   bool        `json:"highlight_new_comments"`
	IgnoreSuggestedSort    bool        `json:"ignore_suggested_sort"`
	LabelNsfw              bool        `json:"label_nsfw"`
	Lang                   string      `json:"lang"`
	LegacySearch           bool        `json:"legacy_search"`
	LiveOrangereds         bool        `json:"live_orangereds"`
	MarkMessagesRead       bool        `json:"mark_messages_read"`
	Media                  string      `json:"media"`
	MediaPreview           string      `json:"media_preview"`
	MinCommentScore        int         `json:"min_comment_score"`
	MinLinkScore           int         `json:"min_link_score"`
	MonitorMentions        bool        `json:"monitor_mentions"`
	Newwindow              bool        `json:"newwindow"`
	NoProfanity            bool        `json:"no_profanity"`
	NumComments            int         `json:"num_comments"`
	Numsites               int         `json:"numsites"`
	Organic                bool        `json:"organic"`
	Over18                 bool        `json:"over_18"`
	PrivateFeeds           bool        `json:"private_feeds"`
	PublicServerSeconds    bool        `json:"public_server_seconds"`
	PublicVotes            bool        `json:"public_votes"`
	Research               bool        `json:"research"`
	ShowFlair              bool        `json:"show_flair"`
	ShowGoldExpiration     bool        `json:"show_gold_expiration"`
	ShowLinkFlair          bool        `json:"show_link_flair"`
	ShowPromote            bool        `json:"show_promote"`
	ShowSnoovatar          bool        `json:"show_snoovatar"`
	ShowStylesheets        bool        `json:"show_stylesheets"`
	ShowTrending           bool        `json:"show_trending"`
	StoreVisits            bool        `json:"store_visits"`
	ThreadedMessages       bool        `json:"threaded_messages"`
	ThreadedModmail        bool        `json:"threaded_modmail"`
	UseGlobalDefaults      bool        `json:"use_global_defaults"`
}

Preferences contains a user's account preferences.

type Subreddit

type Subreddit struct {
	AccountsActive          int    `json:"accounts_active"`
	BannerImg               string `json:"banner_img"`
	BannerSize              []int  `json:"banner_size"`
	CollapseDeletedComments bool   `json:"collapse_deleted_comments"`
	CommentScoreHideMins    int    `json:"comment_score_hide_mins"`
	Created                 int    `json:"created"`
	CreatedUtc              int    `json:"created_utc"`
	Description             string `json:"description"`
	DescriptionHTML         string `json:"description_html"`
	DisplayName             string `json:"display_name"`
	HeaderImg               string `json:"header_img"`
	HeaderSize              []int  `json:"header_size"`
	HeaderTitle             string `json:"header_title"`
	HideAds                 bool   `json:"hide_ads"`
	IconImg                 string `json:"icon_img"`
	IconSize                []int  `json:"icon_size"`
	ID                      string `json:"id"`
	KeyColor                string `json:"key_color"`
	Lang                    string `json:"lang"`
	Name                    string `json:"name"`
	Over18                  bool   `json:"over18"`
	PublicDescription       string `json:"public_description"`
	PublicDescriptionHTML   string `json:"public_description_html"`
	PublicTraffic           bool   `json:"public_traffic"`
	Quarantine              bool   `json:"quarantine"`
	ShowMedia               bool   `json:"show_media"`
	ShowMediaPreview        bool   `json:"show_media_preview"`
	SubmissionType          string `json:"submission_type"`
	SubmitLinkLabel         string `json:"submit_link_label"`
	SubmitText              string `json:"submit_text"`
	SubmitTextHTML          string `json:"submit_text_html"`
	SubmitTextLabel         string `json:"submit_text_label"`
	SubredditType           string `json:"subreddit_type"`
	Subscribers             int    `json:"subscribers"`
	SuggestedCommentSort    string `json:"suggested_comment_sort"`
	Title                   string `json:"title"`
	URL                     string `json:"url"`
	UserIsBanned            bool   `json:"user_is_banned"`
	UserIsContributor       bool   `json:"user_is_contributor"`
	UserIsModerator         bool   `json:"user_is_moderator"`
	UserIsMuted             bool   `json:"user_is_muted"`
	UserIsSubscriber        bool   `json:"user_is_subscriber"`
	UserSrThemeEnabled      bool   `json:"user_sr_theme_enabled"`
	WikiEnabled             bool   `json:"wiki_enabled"`
}

Subreddit contains subreddit information.

Jump to

Keyboard shortcuts

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