Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HTMLInfo ¶
type HTMLInfo struct { // http.Client instance to use, if nil then will be used default client Client *http.Client `json:"-"` // If it's true then parser will fetch oembed data from oembed url if possible AllowOembedFetching bool `json:"-"` // If it's true parser will extract main page content from html AllowMainContentExtraction bool `json:"-"` // We'll forward it to Oembed' fetchOembed method AcceptLanguage string `json:"-"` Title string `json:"title"` Description string `json:"description"` AuthorName string `json:"author_name"` CanonicalURL string `json:"canonical_url"` OembedJSONURL string `json:"oembed_json_url"` OembedXMLURL string `json:"oembed_xml_url"` FaviconURL string `json:"favicon_url"` TouchIcons []*TouchIcon `json:"touch_icons"` ImageSrcURL string `json:"image_src_url"` // Readability package is being used inside MainContent string `json:"main_content"` OGInfo *opengraph.OpenGraph `json:"opengraph"` OembedInfo *oembed.Info `json:"oembed"` // contains filtered or unexported fields }
HTMLInfo contains information extracted from HTML page
func (*HTMLInfo) GenerateOembedFor ¶
GenerateOembedFor return Oembed Info for given url based on previously parsed data The returned oembed data is also updated in info.OembedInfo Example:
info := NewHTMLInfo() info.Parse(dataReader, &sourceURL) oembed := info.GenerateOembedFor(sourceURL)
Click to show internal directories.
Click to hide internal directories.