Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // LINK2JSON_DEBUG enables or disables debug logging. LINK2JSON_DEBUG bool )
Functions ¶
Types ¶
type MetaDataResponseItem ¶
type MetaDataResponseItem struct {
Title string `json:"title"`
Description string `json:"description"`
Images []WebImage `json:"images"`
Sitename string `json:"sitename"`
Favicon string `json:"favicon"`
Duration int `json:"duration"`
Domain string `json:"domain"`
URL string `json:"url"`
}
func GetMetadata ¶
func GetMetadata(targetURL string) (*MetaDataResponseItem, error)
GetMetadata fetches and returns metadata for the given URL. It first attempts to use Colly for scraping. If Colly fails to extract sufficient metadata, it falls back to Chromedp. Domains requiring Chromedp are cached for future requests.
Click to show internal directories.
Click to hide internal directories.