scraper

package
v0.0.0-...-f106db0 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2024 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetWebsiteDescription

func GetWebsiteDescription(url string) (string, error)

Get the website page description by a url string provided accesing the og:description of website url, will return either the description or empty string if it cannot find.

func GetWebsiteImg

func GetWebsiteImg(url string) (string, error)

Get the website page image by a url string provided accesing the og:image of website url, will return either the image or empty string if it cannot find.

func GetWebsiteLocale

func GetWebsiteLocale(url string) (string, error)

Get the website locale by a url string provided accesing the og:locale of website url, will return either the locale or empty string if it cannot find.

func GetWebsiteLogo(url string) (string, error)

Get the website logo by a url string provided, will return either the logo or empty string if it cannot find; check the full websites json if logos in: https://github.com/pedrosouza458/go-open-graph-scraper/blob/main/utils/websites.json.

func GetWebsiteName

func GetWebsiteName(rawurl string) (string, error)

Get the website name by a url string provided, will return either the name or empty string if it cannot find.

func GetWebsitePageTitle

func GetWebsitePageTitle(url string) (string, error)

Get the website title by a url string provided accesing the og:title of website url, will return either the title or empty string if it cannot find.

func GetWebsiteType

func GetWebsiteType(url string) (string, error)

Get the website page type object by a url string provided accesing the og:type of website url, will return either the type object or empty string if it cannot find.

func GetWebsiteVideo

func GetWebsiteVideo(url string) (string, error)

Get the website video by a url string provided accesing the og:video of website url, will return either the video url or empty string if it cannot find.

Types

type GenericDetails

type GenericDetails struct{}

No specific metadata details

type MusicDetails

type MusicDetails struct {
	Duration    int      `json:"duration,omitempty"`
	Album       string   `json:"album,omitempty"`
	Musician    []string `json:"musician,omitempty"`
	ReleaseDate string   `json:"release_date,omitempty"`
}

Music type details

type OpenGraphResponse

type OpenGraphResponse struct {
	Type    string      `json:"type"`
	Details interface{} `json:"details,omitempty"`
}

Base struct for the JSON response

type VideoDetails

type VideoDetails struct {
	Duration    int      `json:"duration,omitempty"`
	ReleaseDate string   `json:"release_date,omitempty"`
	Actor       []string `json:"actor,omitempty"`
	Director    []string `json:"director,omitempty"`
	Writer      []string `json:"writer,omitempty"`
	Tag         []string `json:"tag,omitempty"`
}

Video type details

type Website

type Website struct {
	Website string `json:"website"`
}

Jump to

Keyboard shortcuts

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