pagecard

package module
v0.0.0-...-5469ab2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 22, 2016 License: MIT Imports: 3 Imported by: 0

README

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.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Info

type Info struct {
	OpenGraph *opengraph.Object
	Twitter   *twitter.Card
}

Info contains all the data retrieved from the opengraph and twitter cards metatags in a webpage.

func Get

func Get(url string) (*Info, error)

Get retrieves the Info of a webpage with the given URL.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL