Documentation ¶
Index ¶
Constants ¶
View Source
const HITS_PER_PAGE = 100
View Source
const MAX_PAGES = 3
View Source
const MAX_RESULTS = 100
Variables ¶
View Source
var ( ClientID = os.Getenv("REDDIT_CLIENT_ID") ClientSecret = os.Getenv("REDDIT_CLIENT_SECRET") Username = os.Getenv("REDDIT_USERNAME") Password = os.Getenv("REDDIT_PASSWORD") UserAgent = os.Getenv("REDDIT_USER_AGENT") )
Replace with your own client ID and client secret
View Source
var (
YTApiKey = os.Getenv("YOUTUBE_API_KEY")
)
Functions ¶
This section is empty.
Types ¶
type Article ¶
type ArticleData ¶
type ArticleData struct { Title string `json:"title"` Created string `json:"created"` Ups int `json:"ups"` NumComments int `json:"num_comments"` Url string `json:"url"` }
func FetchRedditPosts ¶
func FetchRedditPosts(query string, minUpvotes int) ([]ArticleData, error)
type HNHit ¶
type HNHit struct { Title string `json:"title"` CreatedAt string `json:"created_at"` Points int `json:"points"` NumComments int `json:"num_comments"` URL string `json:"url"` StoryURL string `json:"story_url"` ObjectID string `json:"objectID"` HighlightResult HighlightResult `json:"_highlightResult"` }
type HNResponse ¶
type HighlightResult ¶
type RedditResponse ¶
type RedditResponse struct { Data struct { Children []struct { Data PostData `json:"data"` } `json:"children"` } `json:"data"` }
type TokenResponse ¶
type TokenResponse struct {
AccessToken string `json:"access_token"`
}
type YTVideoMetadata ¶
type YTVideoMetadata struct { VideoID string `json:"video_id"` Title string `json:"title"` ViewCount uint64 `json:"view_count"` PublishedAt string `json:"published_at"` VideoURL string `json:"video_url"` }
func FetchYouTubeVideos ¶
func FetchYouTubeVideos(query string, limit int) ([]YTVideoMetadata, error)
Click to show internal directories.
Click to hide internal directories.