# README
Open Graph Parser for Golang
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
og.Parse(body *io.Reader)
to re-use*http.Response
og.HTTPClient
to customize*http.Client
for fetchingog.ToAbsURL()
to restore relative URL, e.g.og.Favicon
You ain't gonna need itog.Fulfill()
to fill empty fileds.
# 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.