{"id":16776390,"url":"https://github.com/phoqe/ogge","last_synced_at":"2026-01-03T13:32:16.930Z","repository":{"id":117348792,"uuid":"427154645","full_name":"phoqe/Ogge","owner":"phoqe","description":"Convenient and efficient Swift wrapper for the Open Graph Protocol.","archived":false,"fork":false,"pushed_at":"2021-11-18T07:57:46.000Z","size":50,"stargazers_count":0,"open_issues_count":3,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-23T05:14:15.648Z","etag":null,"topics":["async","await","codable","dom","html","meta","ogp","open-graph-protocol","parser","regex","swift","wrapper"],"latest_commit_sha":null,"homepage":"","language":"Swift","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/phoqe.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license.md","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":"2021-11-11T21:57:08.000Z","updated_at":"2021-11-18T07:57:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"540df807-c1f6-4c7d-937f-6d896e9fca81","html_url":"https://github.com/phoqe/Ogge","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phoqe%2FOgge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phoqe%2FOgge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phoqe%2FOgge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phoqe%2FOgge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phoqe","download_url":"https://codeload.github.com/phoqe/Ogge/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243910749,"owners_count":20367545,"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":["async","await","codable","dom","html","meta","ogp","open-graph-protocol","parser","regex","swift","wrapper"],"created_at":"2024-10-13T07:09:48.182Z","updated_at":"2026-01-03T13:32:16.905Z","avatar_url":"https://github.com/phoqe.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ogge\n\nOgge is a convenient and efficient Swift wrapper for the Open Graph Protocol.\nIt was created in parallel with a newsreader app to fetch an image from an article.\n\n## Installation\n\nOgge is available as a Swift Package:\n\n```swift\n.package(url: \"https://github.com/phoqe/Ogge.git\", .branch(\"master\"))\n```\n\n## Usage\n\nYou can use Ogge in multiple ways depending on the available data.\n\n### URL\n\n[`OGRepo`](Sources/Ogge/OGRepo.swift) can fetch HTML from a URL and parse it into an [`OGObject`](Sources/Ogge/Models/OGObject.swift):\n\n#### [`async/await`](https://docs.swift.org/swift-book/LanguageGuide/Concurrency.html)\n\n```swift\nlet url = URL(string: \"https://example.com\")!\nlet object = try await OGRepo.object(from: url)\n```\n\n#### [`Result`](https://developer.apple.com/documentation/swift/result)\n\n```swift\nlet url = URL(string: \"https://example.com\")!\n\nOGRepo.object(from: url, completion: { result in\n    switch (result) {\n    case .failure(let error):\n        \n        break\n        \n    case .success(let object):\n        \n        break\n    }\n})\n```\n\n### HTML\n\n[`OGParser`](Sources/Ogge/OGParser.swift) can parse HTML and parse it into an [`OGObject`](Sources/Ogge/Models/OGObject.swift):\n\n```swift\nlet html = \"\"\"\n\u003cmeta property=\"og:title\" content=\"The Rock\"\u003e\n\u003cmeta property=\"og:type\" content=\"video.movie\"\u003e\n\u003cmeta property=\"og:url\" content=\"https://www.imdb.com/title/tt0117500\"\u003e\n\u003cmeta property=\"og:image\" content=\"https://ia.media-imdb.com/images/rock.jpg\"\u003e\n\"\"\"\nlet object = try OGParser.parse(html: html)\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphoqe%2Fogge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphoqe%2Fogge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphoqe%2Fogge/lists"}