Categorygithub.com/dariallab/opengraph
modulepackage
1.1.3
Repository: https://github.com/dariallab/opengraph.git
Documentation: pkg.go.dev

# README

Open Graph Parser for Golang

Go codecov GoDoc

Code Example

package main

import (
	"fmt"
	"github.com/otiai10/opengraph"
)

func main() {
	og, err := opengraph.Fetch("https://www.youtube.com/watch?v=5blm22DeeHY")
	fmt.Printf("OpenGraph: %+v\nError: %v\n", og, err)
}

CLI as a working example

% go get github.com/otiai10/opengraph/ogp
% ogp --help

For more details, see ogp/main.go.

Advanced

# Packages

No description provided by the author

# Functions

Fetch creates and parses OpenGraph with specified URL.
FetchWithContext creates and parses OpenGraph with specified URL.
LinkTag constructs Link.
MetaTag constructs MetaTag.
New creates new OpenGraph struct with specified URL.
TitleTag constructs Title.

# Constants

HTMLLinkTag is a tag name of <link>.
HTMLMetaTag is a tag name of <meta>.
HTMLTitleTag is a tag name of <title>.

# Structs

Link represents any "<link ...>" HTML tag.
Meta represents any "<meta ...>" HTML tag.
OGAudio represents "og:audio" structure.
OGImage represents "og:image" structure.
OGVideo represents "og:video" structure.
OpenGraph represents web page information according to OGP <ogp.me>, and some more additional informations like URL.Host and so.
Title represents any "<title ...>" HTML tag.
URL includes *url.URL.