{"id":13581548,"url":"https://github.com/johnreutersward/opengraph","last_synced_at":"2025-04-06T10:32:33.753Z","repository":{"id":18359574,"uuid":"21539700","full_name":"johnreutersward/opengraph","owner":"johnreutersward","description":"opengraph is a Go library and command-line tool for extracting Open Graph metadata from HTML documents","archived":false,"fork":false,"pushed_at":"2021-01-16T12:21:08.000Z","size":40,"stargazers_count":29,"open_issues_count":0,"forks_count":7,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-21T18:42:39.623Z","etag":null,"topics":["opengraph"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/johnreutersward/opengraph","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/johnreutersward.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-07-06T12:35:47.000Z","updated_at":"2023-04-05T16:59:19.000Z","dependencies_parsed_at":"2022-09-02T13:31:25.981Z","dependency_job_id":null,"html_url":"https://github.com/johnreutersward/opengraph","commit_stats":null,"previous_names":["rojters/opengraph"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnreutersward%2Fopengraph","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnreutersward%2Fopengraph/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnreutersward%2Fopengraph/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnreutersward%2Fopengraph/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/johnreutersward","download_url":"https://codeload.github.com/johnreutersward/opengraph/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247470360,"owners_count":20944146,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["opengraph"],"created_at":"2024-08-01T15:02:05.368Z","updated_at":"2025-04-06T10:32:33.295Z","avatar_url":"https://github.com/johnreutersward.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# opengraph\n\n[![Build Status](https://travis-ci.org/johnreutersward/opengraph.svg?branch=master)](https://travis-ci.org/johnreutersward/opengraph)\n[![Go Reference](https://pkg.go.dev/badge/github.com/johnreutersward/opengraph.svg)](https://pkg.go.dev/github.com/johnreutersward/opengraph)\n[![Go Report Card](https://goreportcard.com/badge/github.com/johnreutersward/opengraph)](https://goreportcard.com/report/github.com/johnreutersward/opengraph)\n\n![ogp](ogp.png?raw=true \"ogp\")\n\n\u003e opengraph is a Go library and command-line tool for extracting [Open Graph](https://ogp.me/ \"Open Graph protocol\") metadata from HTML documents.\n\n## Library\n\n### Install\n\n```go\nimport \"github.com/johnreutersward/opengraph\"\n```\n\n### Usage\n\nTo extract Open Graph metadata from a movie on IMDb (sans error handling)\n\n```go\nres, _ := http.Get(\"http://www.imdb.com/title/tt0118715/\")\nmd, _ := opengraph.Extract(res.Body)\nfor i := range md {\n\tfmt.Printf(\"%s = %s\\n\", md[i].Property, md[i].Content)\n}\n```\n\nWhich will output\n\n```\nurl = http://www.imdb.com/title/tt0118715/\ntype = video.movie\ntitle = The Big Lebowski (1998)\nsite_name = IMDb\ndescription = Directed by Joel Coen, Ethan Coen.  With Jeff Bridges ...\n...\n```\n\n## Command-line tool\n\n### Install\n\nBinary releases: \n\nhttps://github.com/johnreutersward/opengraph/releases\n\nOr build from source:\n\n```\n$ go get github.com/johnreutersward/opengraph/cmd/opengraph\n```\n\n### Usage\n\n```\n$ opengraph http://www.imdb.com/title/tt0118715/\ntype: video.movie\ntitle: The Big Lebowski (1998)\nsite_name: IMDb\n...\n```\n\nOutput in JSON:\n\n```\n$ opengraph -json http://www.imdb.com/title/tt0118715/\n[\n  {\n    \"Property\": \"type\",\n    \"Content\": \"video.movie\",\n    \"Prefix\": \"og\"\n  },\n  {\n    \"Property\": \"title\",\n    \"Content\": \"The Big Lebowski (1998)\",\n    \"Prefix\": \"og\"\n  },\n  {\n    \"Property\": \"site_name\",\n    \"Content\": \"IMDb\",\n    \"Prefix\": \"og\"\n  },\n  ...\n]\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnreutersward%2Fopengraph","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjohnreutersward%2Fopengraph","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnreutersward%2Fopengraph/lists"}