/pagecard

Golang library to get twitter cards, open graph and other metadata from any webpage.

Primary LanguageGoMIT LicenseMIT

pagecard Build Status Coverage Status GoDoc

Golang library to retrieve some useful data to represent a webpage in other applications from metadata exposed by the webpage. To do so, this library reads all the meta tags on the page and builds a data structure containing the information from OpenGraph, Twitter and some other useful tags.

Install

go get github.com/mvader/pagecard

Usage

func main() {
  info, err := pagecard.Get("http://www.imdb.com/title/tt0094721/")
  if err != nil {
    log.Fatal(err)
  }

  fmt.Println(info.OpenGraph.Title) // Beetlejuice (1988)
}

Future additions

  • Retrieve color exposed with <meta name="theme-color">
  • Retrieve iTunes app with <meta name="apple-itunes-app">
  • Retrieve icon sets with the Apple Icons and Microsoft tiles.