{"id":15037838,"url":"https://github.com/awkward/ocarina","last_synced_at":"2025-04-09T23:32:56.747Z","repository":{"id":47637441,"uuid":"81953322","full_name":"awkward/Ocarina","owner":"awkward","description":"A library to get metadata and Open Graph information from URLs","archived":false,"fork":false,"pushed_at":"2021-08-20T08:53:06.000Z","size":147,"stargazers_count":38,"open_issues_count":3,"forks_count":12,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-03-24T01:22:53.466Z","etag":null,"topics":["ios","swift","swift-3"],"latest_commit_sha":null,"homepage":null,"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/awkward.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":"2017-02-14T14:26:46.000Z","updated_at":"2022-11-02T00:46:15.000Z","dependencies_parsed_at":"2022-09-15T22:10:30.700Z","dependency_job_id":null,"html_url":"https://github.com/awkward/Ocarina","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awkward%2FOcarina","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awkward%2FOcarina/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awkward%2FOcarina/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awkward%2FOcarina/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/awkward","download_url":"https://codeload.github.com/awkward/Ocarina/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248129969,"owners_count":21052670,"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":["ios","swift","swift-3"],"created_at":"2024-09-24T20:36:01.375Z","updated_at":"2025-04-09T23:32:56.723Z","avatar_url":"https://github.com/awkward.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n  \u003cimg src=\"Docs/icon.png\" width=\"136\" alt=\"icon\"\u003e\u003cbr\u003e\n  Ocarina\u003cbr\u003e\n  \u003cp align=\"center\"\u003e\n  \u003ca href=\"https://travis-ci.org/awkward/Ocarina\"\u003e\n    \u003cimg src=\"https://travis-ci.org/awkward/Ocarina.svg?branch=master\" alt=\"Build Status\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://twitter.com/madeawkward\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/contact-madeawkward-blue.svg?style=flat\" alt=\"Contact\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://opensource.org/licenses/MIT\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" alt=\"License: MIT\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\u003c/h1\u003e\n\nA library to receive metadata and Open Graph information from URLs.\n\n### Introduction\n\nHi, we're [Awkward](https://awkward.co/). We were looking for a way to visualize information behind links to present these in our iOS reddit client called [Beam](https://beamreddit.com/). We initially used a server to receive metadata, but the server became quite crowded with calls. We built Ocarina as a solution to that problem. Fallbacks for basic HTML tags and Twitter card information make this metadata fetcher unique. We welcome you to use Ocarina for your own projects.\n\n### Features\n\n- Fetching of basic metadata for individual links using the OGP protocol or basic HTML tags (twitter card information also available)\n- Memory cache of metadata for each link\n- Prefetching a set of links to make views more responsive\n- Link information can include: type, title, description, image, image size, favicon, and Apple touch icon\n\n### Installation\n\n\n1. Drag Ocarina.xcodeproj into your project\n2. Go to your project\n3. Select General\n4. Under \"Frameworks, Libraries, and Embedded Content\" press + and select Ocarina.framework\n5. Select Build Settings\n6. Search for `Other Linker Flags` and add `-lxml2` (Make sure you click \"All\" at the top instead of \"Basic\" to see `Other Linker Flags`)\n\n### Usage\n\n### Fetching information for a single link\n\n```Swift\nlet url = URL(string: \"https://awkward.co\")!\nurl.oca.fetchInformation(completionHandler: { (information, error) in\n  if let information = information {\n    print(String(describing: information.title))\n  } else if let error = error {\n    print(String(describing: error))\n  }\n\n})\n```\n\n### Prefetching multiple links\n\nOcarinaPrefetcher allows prefetching links into the cache, this allows for the UI to look more responsive.\n\n```Swift\nlet urls = [\n  URL(string: \"https://awkward.co\")!,\n  URL(string: \"https://facebook.com\")!,\n  URL(string: \"https://nytimes.com\")!,\n  URL(string: \"https://latimes.com\")!\n]\nlet prefetcher = OcarinaPrefetcher(urls: urls, completionHandler: { (errors) in§\n  print(\"Done pre-fetching links\")\n})\n```\n\nFor other uses, see the example project\n\n### Contributing\n\nContributing is easy. If you want to report an error of any kind, please create an issue. If you want to propose a change, a pull request is the right way to go.\n\n### License\n\n\n\u003e Ocarina is available under the MIT license. See the LICENSE file for more info.\n\n### Links\n\n  - [Awkward](https://awkward.co)\n  - [Beam](https://beamreddit.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fawkward%2Focarina","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fawkward%2Focarina","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fawkward%2Focarina/lists"}