Documentation ¶
Overview ¶
Package opengraph extracts Open Graph metadata from HTML documents. See http://ogp.me/ for more information about the Open Graph protocol.
Usage:
import "github.com/rojters/opengraph"
To extract Open Graph metadata from a movie on IMDb (sans error handling):
res, _ := http.Get("http://www.imdb.com/title/tt0118715/") md, _ := opengraph.Extract(res.Body) for i := range md { fmt.Printf("%s = %s\n", md[i].Property, md[i].Content) }
Which will output:
url = http://www.imdb.com/title/tt0118715/ type = video.movie title = The Big Lebowski (1998) site_name = IMDb description = Directed by Joel Coen, Ethan Coen. With Jeff Bridges ... ...
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MetaData ¶
type MetaData struct { Property string // Property attribute without prefix. Content string // Content attribute. See http://ogp.me/#data_types for a list of content attribute types. Prefix string }
Click to show internal directories.
Click to hide internal directories.