{"id":18522437,"url":"https://github.com/astro/node-oembed","last_synced_at":"2025-04-09T11:30:52.629Z","repository":{"id":2070797,"uuid":"3009667","full_name":"astro/node-oembed","owner":"astro","description":"oEmbed consumer library for node.js \u0026 tools","archived":false,"fork":false,"pushed_at":"2017-02-04T22:08:21.000Z","size":19,"stargazers_count":37,"open_issues_count":6,"forks_count":15,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-24T04:51:41.080Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/astro.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":"2011-12-19T03:31:13.000Z","updated_at":"2024-02-21T15:55:51.000Z","dependencies_parsed_at":"2022-08-22T22:01:01.003Z","dependency_job_id":null,"html_url":"https://github.com/astro/node-oembed","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astro%2Fnode-oembed","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astro%2Fnode-oembed/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astro%2Fnode-oembed/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astro%2Fnode-oembed/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/astro","download_url":"https://codeload.github.com/astro/node-oembed/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248031049,"owners_count":21036324,"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":[],"created_at":"2024-11-06T17:30:56.259Z","updated_at":"2025-04-09T11:30:52.283Z","avatar_url":"https://github.com/astro.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"node-oembed\n===========\n\nFrom [oEmbed.com](http://oembed.com/):\n\n\u003e oEmbed is a format for allowing an embedded representation of a URL\n\u003e on third party sites. The simple API allows a website to display\n\u003e embedded content (such as photos or videos) when a user posts a link\n\u003e to that resource, without having to parse the resource directly.\n\nThis library allows you to discover and retrieve the oEmbed JSON\ndescriptors for these posts. It automatically converts the additional\nXML format to JavaScript objects for your convenience.  This package\ncomes with multiple tools that allow you to consume oEmbed\ninformation.\n\n\nInstallation\n------------\n\n    npm i oembed\n\nDon't forget to put it in `dependencies` of your `package.json` later\nif you use this in a node app.\n\n\nFeatures\n--------\n\n* Supports both\n\n  * application/json+oembed\n  * text/xml+oembed\n\n* Automatic [Embed.ly](http://embed.ly/) fallback when an API key is provided\n* Uses [htmlparser](https://github.com/tautologistics/node-htmlparser/) for HTML and XML parsing\n\n\nTools (bin/)\n------------\n\n### oembed_get \u0026lt;URL\u0026gt;\n\nRetrieve and display oEmbed information for a custom URL.\n\n### oembed_httpd \u0026lt;bind-port\u0026gt; [bind-host]\n\nReplicates the embed.ly API in a simple Web server.\n\n### oembed_diff_json_xml \u0026lt;URL\u0026gt;\n\nCompare JSON and XML descriptors for a URL.\n\n\nAPI (require('oembed'))\n-----------------------\n\nIn a real-world app all you should need is the *fetch* function to get\noEmbed information. We always use the `function callback(error,\nresult)` convention.\n\n```javascript\noembed.fetch(url, { maxwidth: 1920 }, function(error, result) {\n    if (error)\n        console.error(error);\n    else\n        console.log(\"oEmbed result\", result);\n});\n```\n\nThe two steps can be executed separately whenever you need more\ncontrol:\n\n* `oembed.discover(url, callback)` finds all `\u003clink rel=\"alternate\"\u003e`\n  in a document\n* Get and parse descriptors immediately with `oembed.fetchJSON(url,\n  callback)` and `oembed.fetchXML(url, callback)` if you have\n  discovery information already\n\n\n### Embed.ly fallback\n\nThe Embed.ly service can deliver oEmbed information even for resources\nthat don't provide oEmbed links. Go\n[sign up](https://app.embed.ly/pricing/free) with them and configure\nyour API key like:\n\n```javascript\noembed.EMBEDLY_KEY = \"...\";\n```\n\nTODO\n----\n\n* Document size limits?\n* bin/oembed_httpd: Multiple URLs like embed.ly\n* bin/oembed_httpd: Pass through for ETags and Last-Modified\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fastro%2Fnode-oembed","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fastro%2Fnode-oembed","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fastro%2Fnode-oembed/lists"}