Skip to content

Latest commit

 

History

History
52 lines (40 loc) · 1.24 KB

File metadata and controls

52 lines (40 loc) · 1.24 KB

MetaMonster

Build button

A Golang project allowing retrieval of HTML metadata of content driven sites.

Example

Example Usage && Output

Installation

First, install golang if you haven't already. Then run

go get github.com/briannewsom/metamonster
go install github.com/briannewsom/metamonster

metamonster will now live at $GOPATH/bin/metamonster. I recommend adding $GOPATH/bin to your PATH for simplicity.

Usage

metamonster -h
Usage of metamonster:
	-format="plaintext": Output data format. Options - [json,plaintext]
	-url="": URL from which to retrieve metadata

Or, as an example

metamonster -url="https://medium.com/@sarah_k_mock/meat-is-dead-long-live-meat-a86a7cfe7ecf" -format=json

Using MetaMonster in my Go project

import (
	"github.com/briannewsom/metamonster/fetcher"
	"github.com/briannewsom/metamonster/models/metadata"
)

func main(){
  url := "https://medium.com/@sarah_k_mock/meat-is-dead-long-live-meat-a86a7cfe7ecf"

  m, err := fetcher.GetInfoForUrl(url)

  metadata.PrintMetadata(*m)
}

Development

Testing

go test ./...