Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PrintItems ¶
Prints an array of Item based on a given template format.
The format should follow go's text/template format. For example: "{{.Title}}" would print the titles of each item.
Types ¶
type Item ¶
type Item struct { Id string Title string Url string // The url of the video ThumbUrl string // The thumbnail url ChannelId string ChannelTitle string ChannelUrl string Published string // The published date provided by youtube as is. LengthText string // The length of the video rendered as text by youtube. AtomUrl string ViewCount string }
A Item represents a youtube video, or more precisely its metadata (title, url...).
func Search ¶
Launch a search on the given query, page, language and order and return an array of items and/or an error.
The lang parameter must be a youtube supported language code ("en", "fr", "de"...) and allows getting certain information such as the published date in the selected language. If empty, youtube should detect the language based on location.
The order parameter can be any of the following: relevance, date, views, rating. The default value is relevance.
This function may return items even if there is an error, allowing the search to be considered partially successful. If this is the case it most likely means there was an error during the parse, but some items were still successfully parsed before the error.