Documentation ¶
Overview ¶
Package opg parses the Open Graph Protocol data from HTML documents.
The package follows the specification at [https://ogp.me/].
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Object ¶
type Object struct { Title string Type string Images []*Image URL string Audios []*Audio Description string Determiner string Locale *Locale SiteName string Videos []*Video }
Object represents the Open Graph protocol object.
func Parse ¶
Parse parses the given io.Reader and returns the Open Graph protocol object.
Example ¶
res, err := http.Get("https://ogp.me/") if err != nil { log.Fatal(err) } defer res.Body.Close() obj, err := ogp.Parse(res.Body) if err != nil { log.Fatal(err) } fmt.Println(obj.Title) // Open Graph protocol
Output:
Click to show internal directories.
Click to hide internal directories.