embed

package
v0.0.0-...-977eb4a Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EmbedExtractor

type EmbedExtractor interface {
	// RelevantTagNames returns a set of HTML tag names that are relevant to this extractor.
	RelevantTagNames() []string
	// Extract detects if a node should be extracted as an embedded element; if not return nil.
	Extract(node *html.Node) webdoc.Element
}

EmbedExtractor is interface for extracting embedded nodes int webdoc.Element.

type ImageExtractor

type ImageExtractor struct {
	PageURL *nurl.URL
	// contains filtered or unexported fields
}

ImageExtractor treats images as another type of embed and provides heuristics for lead image candidacy.

func NewImageExtractor

func NewImageExtractor(pageURL *nurl.URL, logger logutil.Logger) *ImageExtractor

func (*ImageExtractor) Extract

func (ie *ImageExtractor) Extract(node *html.Node) webdoc.Element

func (*ImageExtractor) RelevantTagNames

func (ie *ImageExtractor) RelevantTagNames() []string

type TwitterExtractor

type TwitterExtractor struct {
	PageURL *nurl.URL
	// contains filtered or unexported fields
}

TwitterExtractor is used to look for Twitter embeds. This class will looks for both rendered and unrendered tweets.

func NewTwitterExtractor

func NewTwitterExtractor(pageURL *nurl.URL, logger logutil.Logger) *TwitterExtractor

func (*TwitterExtractor) Extract

func (te *TwitterExtractor) Extract(node *html.Node) webdoc.Element

func (*TwitterExtractor) RelevantTagNames

func (te *TwitterExtractor) RelevantTagNames() []string

type VimeoExtractor

type VimeoExtractor struct {
	PageURL *nurl.URL
	// contains filtered or unexported fields
}

VimeoExtractor is used for extracting Vimeo videos and relevant information.

func NewVimeoExtractor

func NewVimeoExtractor(pageURL *nurl.URL, logger logutil.Logger) *VimeoExtractor

func (*VimeoExtractor) Extract

func (ve *VimeoExtractor) Extract(node *html.Node) webdoc.Element

func (*VimeoExtractor) RelevantTagNames

func (ve *VimeoExtractor) RelevantTagNames() []string

type YouTubeExtractor

type YouTubeExtractor struct {
	PageURL *nurl.URL
	// contains filtered or unexported fields
}

YouTubeExtractor is used for extracting YouTube videos and relevant information.

func NewYouTubeExtractor

func NewYouTubeExtractor(pageURL *nurl.URL, logger logutil.Logger) *YouTubeExtractor

func (*YouTubeExtractor) Extract

func (ye *YouTubeExtractor) Extract(node *html.Node) webdoc.Element

func (*YouTubeExtractor) RelevantTagNames

func (ye *YouTubeExtractor) RelevantTagNames() []string

Jump to

Keyboard shortcuts

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