youtube

package
v0.0.0-...-89d086a Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2020 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SortBy

func SortBy(vs []VideoStatistics, sortingColumn string)

SortBy sorts videos by some params

Types

type Channel

type Channel struct {
	NextPageToken string `json:"nextPageToken"`
	PageInfo      struct {
		TotalResults int `json:"totalResults"`
	}
	Items []struct {
		PlaylistID string `json:"id"`
	} `json:"items"`
}

Channel datastructure for JSON unmarshalling

type Playlist

type Playlist struct {
	NextPageToken string `json:"nextPageToken"`
	PageInfo      struct {
		TotalResults int `json:"totalResults"`
	}
	Items []struct {
		Snippet struct {
			Title       string `json:"title"`
			Description string `json:"Description"`
		}
		ContentDetails struct {
			VideoID          string `json:"videoId"`
			VideoPublishedAt string `json:"videoPublishedAt"`
		} `json:"contentDetails"`
	} `json:"items"`
}

Playlist datastructure for JSON unmarshalling

type Video

type Video struct {
	Items []struct {
		ID         string `json:"id"`
		Statistics struct {
			ViewCount    string `json:"viewCount"`
			LikeCount    string `json:"likeCount"`
			DislikeCount string `json:"dislikeCount"`
			CommentCount string `json:"commentCount"`
		} `json:"statistics"`
	} `json:"items"`
}

Video datastructure for JSON unmarshalling and future ranking

type VideoStatistics

type VideoStatistics struct {
	Key                         string    `header:"Key"`
	Title                       string    `header:"Title"`
	URL                         string    `header:"URL"`
	PublishedAt                 time.Time `header:"Published at"`
	ViewCount                   int       `header:"View count"`
	LikeCount                   int       `header:"Like count"`
	DislikeCount                int       `header:"Dislike count"`
	CommentCount                int       `header:"Comment count"`
	PositiveInterestingness     float64   `header:"Positive interestingness"`
	PositiveNegativeCoefficient float64   `header:"Positive/hegative coefficient"`
	GlobalBuzzIndex             int       `header:"Global buzz index"`
	TotalReaction               int       `header:"Total reaction"`
	TotalInterestingness        float64   `header:"Total reaction"`
}

VideoStatistics statistics of a singular playlist

func ChannelStatistics

func ChannelStatistics(cid string, apiKey string, debug bool) []VideoStatistics

ChannelStatistics returns videos statistics of a Youtube channel

func PlaylistStatistics

func PlaylistStatistics(playlistKey string, apiKey string, pageToken string, debug bool) []VideoStatistics

PlaylistStatistics returns videos statistics of a Youtube playlist

Jump to

Keyboard shortcuts

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