A Golang project allowing retrieval of HTML metadata of content driven sites.
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.
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
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)
}
go test ./...