Documentation ¶
Overview ¶
Package recon scrapes URLs for OpenGraph information.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DefaultImageLookupTimeout = 10 * time.Second
DefaultImageLookupTimeout is the maximum amount of time recon will spend downloading and analyzing images
var OptimalAspectRatio = 1.91
OptimalAspectRatio is the target aspect ratio that recon favors when looking at images
Functions ¶
This section is empty.
Types ¶
type Image ¶
type Image struct { URL string `json:"url"` Type string `json:"type"` Width int `json:"width"` Height int `json:"height"` Alt string `json:"alt"` AspectRatio float64 `json:"aspectRatio"` Preferred bool `json:"preferred,omitempty"` }
Image contains information about parsed images on the page
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
Parser is the client object and holds the relevant information needed when parsing a URL
func (*Parser) WithClient ¶
WithClient allows the user to specify a custom HTTP client that the parser will use.
func (*Parser) WithHeaders ¶
WithHeaders allows the user to set the HTTP request headers
func (*Parser) WithImageLookupTimeout ¶
WithImageLookupTimeout allows the user to set the maximum amount of time recon will spend parsing images.
func (*Parser) WithTokenMaxBuffer ¶
WithTokenMaxBuffer limits the amount of memory used by the HTML tokenizer.
type Result ¶
type Result struct { // URL is either the URL as-passed or the defined URL (via og:url) if present URL string `json:"url"` // Host is the domain of the URL as-passed or the defined URL if present Host string `json:"host"` // Site is the name of the site as defined via og:site_name or site_name Site string `json:"site_name"` // Title is the title of the page as defined via og:title or title Title string `json:"title"` // Type is the type of the page (article, video, etc.) as defined via og:type or type. Type string `json:"type"` // Description is the description of the page as defined via og:description or description. Description string `json:"description"` // Author is the author of the page as defined via og:author or author. Author string `json:"author"` // Publisher is the publisher of the page as defined via og:publisher or publisher. Publisher string `json:"publisher"` // Images is the collection of images parsed from the page using either og:image meta tags or <img> tags. Images []Image `json:"images"` // Scraped is the time when the page was scraped (or the time Parse was run). Scraped time.Time `json:"scraped"` }
Result is what comes back from a Parse