{"id":15373200,"url":"https://github.com/otiai10/opengraph","last_synced_at":"2025-04-14T06:47:25.929Z","repository":{"id":51071231,"uuid":"102552495","full_name":"otiai10/opengraph","owner":"otiai10","description":"Open Graph Parser for Go","archived":false,"fork":false,"pushed_at":"2023-04-30T18:57:25.000Z","size":89,"stargazers_count":71,"open_issues_count":2,"forks_count":14,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-27T20:38:54.580Z","etag":null,"topics":["go","html","ogp","ogp-image","ogp-meta","ogp-tags"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/otiai10/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/otiai10.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-09-06T02:21:43.000Z","updated_at":"2025-03-13T13:20:28.000Z","dependencies_parsed_at":"2024-06-18T15:26:06.644Z","dependency_job_id":"f8ebe2d1-388e-4d30-9c23-e136e6c81caa","html_url":"https://github.com/otiai10/opengraph","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/otiai10%2Fopengraph","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/otiai10%2Fopengraph/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/otiai10%2Fopengraph/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/otiai10%2Fopengraph/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/otiai10","download_url":"https://codeload.github.com/otiai10/opengraph/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248837274,"owners_count":21169373,"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":["go","html","ogp","ogp-image","ogp-meta","ogp-tags"],"created_at":"2024-10-01T13:54:28.410Z","updated_at":"2025-04-14T06:47:25.889Z","avatar_url":"https://github.com/otiai10.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Open Graph Parser for Golang\n\nGo implementation of https://ogp.me/\n\n[![reference](https://pkg.go.dev/badge/github.com/otiai10/opengraph)](https://pkg.go.dev/github.com/otiai10/opengraph/v2)\n[![Go](https://github.com/otiai10/opengraph/workflows/Go/badge.svg)](https://github.com/otiai10/opengraph/actions)\n[![codecov](https://codecov.io/gh/otiai10/opengraph/branch/main/graph/badge.svg?token=D4mPKqi9fH)](https://codecov.io/gh/otiai10/opengraph)\n[![Maintainability](https://api.codeclimate.com/v1/badges/d063131639023e9a8900/maintainability)](https://codeclimate.com/github/otiai10/opengraph/maintainability)\n[![Go Report Card](https://goreportcard.com/badge/github.com/otiai10/opengraph)](https://goreportcard.com/report/github.com/otiai10/opengraph)\n[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://github.com/otiai10/opengraph/blob/main/LICENSE)\n[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fotiai10%2Fopengraph.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fotiai10%2Fopengraph?ref=badge_shield)\n[![GitHub tag (latest SemVer)](https://img.shields.io/github/v/tag/otiai10/opengraph?sort=semver)](https://pkg.go.dev/github.com/otiai10/opengraph/v2)\n\n# Code Example\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/otiai10/opengraph/v2\"\n)\n\nfunc main() {\n\togp, err := opengraph.Fetch(\"https://github.com/\")\n\tfmt.Println(ogp, err)\n}\n```\n\n# You can try CLI as a working example\n\n```sh\n% go get github.com/otiai10/opengraph/ogp\n% ogp --help\n% ogp -A otiai10.com\n```\n\nJust for fun 😉\n\n# Advanced usage\n\nSet an option for fetching:\n```go\nintent := opengraph.Intent{\n\tContext:     ctx,\n\tHTTPClient:  client,\n\tStrict:      true,\n\tTrustedTags: []string{\"meta\", \"title\"},\n}\nogp, err := opengraph.Fetch(\"https://ogp.me\", intent)\n```\n\nUse any `io.Reader` as a data source:\n\n```go\nf, _ := os.Open(\"my_test.html\")\ndefer f.Close()\nogp := \u0026opengraph.OpenGraph{}\nerr := ogp.Parse(f)\n```\n\nor if you already have parsed `*html.Node`:\n\n```go\nerr := ogp.Walk(node)\n```\n\nDo you wanna make absolute URLs?:\n```go\nogp.Image[0].URL // /logo.png\nogp.ToAbs()\nogp.Image[0].URL // https://ogp.me/logo.png\n```\n\n# Issues\n\n- https://github.com/otiai10/opengraph/issues\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fotiai10%2Fopengraph","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fotiai10%2Fopengraph","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fotiai10%2Fopengraph/lists"}