Skip to content

opengraph is a Go library for extracting Open Graph metadata from html documents

License

Notifications You must be signed in to change notification settings

FourSigma/opengraph

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Open Graph protocol opengraph

opengraph is a Go library for extracting Open Graph metadata from html documents.

Documentation: http://godoc.org/github.com/rojters/opengraph
Open Graph protocol: http://ogp.me/
Build Status: travis-ci status Build Status

Usage

import "github.com/rojters/opengraph"

To extract Open Graph metadata from a movie on IMDb:

res, _ := http.Get("http://www.imdb.com/title/tt0118715/")
og, _ := opengraph.Extract(res.Body)
for _, md := range og {
	fmt.Printf("%s = %s\n", md.Property, md.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 ...
...

License

MIT

About

opengraph is a Go library for extracting Open Graph metadata from html documents

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%