{"id":18979154,"url":"https://github.com/dinostheo/oembedder","last_synced_at":"2026-04-25T21:31:48.460Z","repository":{"id":32621135,"uuid":"138210693","full_name":"dinostheo/oembedder","owner":"dinostheo","description":"Delivers the embedded representation of a URL if one is provided or tries to create on with the information present on the given URL.","archived":false,"fork":false,"pushed_at":"2025-07-18T07:29:37.000Z","size":605,"stargazers_count":1,"open_issues_count":19,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-10T21:22:30.227Z","etag":null,"topics":["nodejs","oembed","web-scraping"],"latest_commit_sha":null,"homepage":null,"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/dinostheo.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":"2018-06-21T18:58:53.000Z","updated_at":"2021-12-09T21:58:29.000Z","dependencies_parsed_at":"2024-11-08T15:45:25.948Z","dependency_job_id":"6dc5e1d8-56e0-441d-ba29-18f8f9226819","html_url":"https://github.com/dinostheo/oembedder","commit_stats":null,"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"purl":"pkg:github/dinostheo/oembedder","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dinostheo%2Foembedder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dinostheo%2Foembedder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dinostheo%2Foembedder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dinostheo%2Foembedder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dinostheo","download_url":"https://codeload.github.com/dinostheo/oembedder/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dinostheo%2Foembedder/sbom","scorecard":{"id":343829,"data":{"date":"2025-08-11","repo":{"name":"github.com/dinostheo/oembedder","commit":"7f2063c8e1da48e62f6e5e53a9bd3bbc784c30ed"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"name":"Code-Review","score":0,"reason":"Found 1/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 1 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"34 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-6chw-6frg-f759","Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-p28h-cc7q-c4fg","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-3gx7-xhv7-5mx3","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj","Warn: Project is vulnerable to: GHSA-2pr6-76vf-7546","Warn: Project is vulnerable to: GHSA-8j8c-7jfh-h6hx","Warn: Project is vulnerable to: GHSA-896r-f27r-55mw","Warn: Project is vulnerable to: GHSA-6c8f-qphg-qjgp","Warn: Project is vulnerable to: GHSA-jf85-cpcp-j695","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-fhjf-83wg-r2j9","Warn: Project is vulnerable to: GHSA-rp65-9cf3-cjxr","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-4g88-fppr-53pp","Warn: Project is vulnerable to: GHSA-4jqc-8m5r-9rpr","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-18T06:36:46.976Z","repository_id":32621135,"created_at":"2025-08-18T06:36:46.976Z","updated_at":"2025-08-18T06:36:46.976Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32278249,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-25T18:29:39.964Z","status":"ssl_error","status_checked_at":"2026-04-25T18:29:32.149Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["nodejs","oembed","web-scraping"],"created_at":"2024-11-08T15:41:28.918Z","updated_at":"2026-04-25T21:31:48.444Z","avatar_url":"https://github.com/dinostheo.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# oembedder\n\n[![CircleCI](https://circleci.com/gh/dinostheo/oembedder/tree/master.svg?style=svg)](https://circleci.com/gh/dinostheo/oembedder/tree/master) [![Known Vulnerabilities](https://snyk.io/test/github/dinostheo/oembedder/badge.svg?targetFile=package.json)](https://snyk.io/test/github/dinostheo/oembedder?targetFile=package.json)\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fdinostheo%2Foembedder.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fdinostheo%2Foembedder?ref=badge_shield)\n\nDelivers the embedded representation of a URL if one is provided or tries to create it with the information present on the given URL.\n\n## Installation\n\n`npm i oembedder`\n\n## Usage\n\nThe `oembedder` module exports a function that accepts two parameters, the url of the resource to get the oEmbed format and an optional configuration object that might contain custom selectors to extract values from a specific resource and/or the provider url.\n\nIf a provider url is given the custom selectors are superfluous.\n\n### Configuration\n\nThe configuration consists of the following two properties (`provider`, `selectors`).\n\n#### Provider\n\nYou can find the oEmbed provider from the [oembed.com](https://oembed.com/#section7) list, or you might know a provider that is not listed there.\n\n_Example provider for youtube:_\n\n```json\n{\n  \"provider_name\": \"YouTube\",\n  \"provider_url\": \"https://www.youtube.com/\",\n  \"endpoints\": [\n    {\n      \"url\": \"https://www.youtube.com/oembed\",\n      \"discovery\": true\n    }\n  ]\n}\n```\n\nThe above JSON is retrieved from [oembed.com](https://oembed.com/#section7) and the library expects the `https://www.youtube.com/oembed` endpoint from the `endpoints` array.\n\n**_If you have a provider that is not included in the list you could follow the instructions and submit it._**\n\nThe oembedder returns a promise that resolves to the oEmbed format of the requested resource, as a javascript object.\n\n##### Example with provider\n\n_Usage:_\n\n```js\nconst oembedder = require('oembedder');\n\nconst provider = 'https://www.youtube.com/oembed';\nconst url = 'https://www.youtube.com/watch?v=_avbO-ckwQw';\n\noembedder(url, provider)\n  .then(console.log)\n  .catch(console.log);\n```\n\n_Response_\n\n```js\n{\n  author_url: 'https://www.youtube.com/user/NBA',\n  type: 'video',\n  provider_url: 'https://www.youtube.com/',\n  thumbnail_url: 'https://i.ytimg.com/vi/_avbO-ckwQw/hqdefault.jpg',\n  thumbnail_width: 480,\n  html: '\u003ciframe width=\"480\" height=\"270\" src=\"https://www.youtube.com/embed/_avbO-ckwQw?feature=oembed\" frameborder=\"0\" allow=\"autoplay; encrypted-media\" allowfullscreen\u003e\u003c/iframe\u003e',\n  provider_name: 'YouTube',\n  thumbnail_height: 360,\n  height: 270,\n  title: '2018 NBA Finals Game 4 Mini-Movie',\n  author_name: 'NBA',\n  version: '1.0',\n  width: 480\n}\n```\n\n##### Example without provider\n\nIf you don't know the provider or there is no oEmbed provider to a specific url. The library will try to resolve the oEmbed format of the resource.\n\n_Usage:_\n\n```js\nconst oembedder = require('oembedder');\n\nconst url = 'http://www.bbc.com/capital/story/20180626-why-owls-might-suffer-in-a-cashless-society';\n\noembedder(url)\n  .then(console.log)\n  .catch(console.log);\n```\n\n_Response_\n\n```js\n{\n  version: '1.0',\n  type: 'link',\n  title: 'The strange reason owl theft may be on the rise ',\n  provider_url: 'http://www.bbc.com/',\n  provider_name: 'www.bbc.com',\n  author_url: 'http://www.bbc.com/',\n  author_name: 'Richard Gray',\n  thumbnail_url:'http://ichef.bbci.co.uk/wwfeatures/live/624_351/images/live/p0/6c/29/p06c29f1.jpg',\n  thumbnail_width: 624,\n  thumbnail_height: 351\n}\n```\n\n#### Selectors\n\nYou can use selectors to extract information from a specific page for a specific property of the oEmbed format. If no selectors are provided a set of default selectors will be used to extract this information. You can overwrite part or all of the default selectors by passing a custom selector for an oEmbed property.\n\nThe current library supports attribute values of matched element, text within its html tag, or the html content.\n\nThe selectors configuration accepts a set of selector objects per property, in case that the information needs to be extracted and combined from a series of html elements.\n\n| Property     | Default selector(s)             | text  | attribute | Default value     |\n| ------------ | ------------------------------- | ----- | --------- | ----------------- |\n| title        | `h1`, `h2`, `div[class$=title]` | true  |           | `undefined`       |\n| providerUrl  |                                 |       |           | `resource domain` |\n| providerName | `meta[property=site_name]`      | false | content   | `resource host`   |\n| authorUrl    |                                 |       |           | `provider url`    |\n| authorName   | `meta[name=author]`             | false | content   | `resource host`   |\n| thumbnail    | `meta[property=\"og:image\"]`     | false | content   | `undefined`       |\n| text\\*       |                                 |       |           | `undefined`       |\n| htmlText\\*\\* |                                 |       |           | `undefined`       |\n\n\\* The `text` property is an extension to possibly extract the text of a resource, which is not defined in the [oembed.com provider response](https://oembed.com/#section2.3).\n\n\\*\\* The `htmlText` property is another extension to possibly extract the text of a resource, similarly with the text property above, but including the html markup.\n\n_Those too extensions intent to enrich the oEmbed format for a better representation on the web._\n\n##### Example with custom selectors\n\nThe following configuration of selectors is set to extract the author name and url of blog post on [medium.com](https://medium.com).\n\n```js\nconst oembedder = require('oembedder');\n\nconst selectors = {\n  authorName: [\n    {\n      selector: 'meta[property=\"author\"]',\n      attribute: 'content'\n    }\n  ],\n  authorUrl: [\n    {\n      selector: 'link[rel=\"author\"]',\n      attribute: 'href'\n    }\n  ]\n};\n\nconst url = 'https://medium.com/the-node-js-collection/native-extensions-for-node-js-767e221b3d26';\n\noembedder(url, { selectors })\n  .then(console.log)\n  .catch(console.log);\n```\n\n#### Example with customer selectors (extract text)\n\n```js\nconst oembedder = require('oembedder');\n\nconst selectors = {\n  authorName: [\n    {\n      selector: 'meta[property=\"author\"]',\n      attribute: 'content'\n    }\n  ],\n  authorUrl: [\n    {\n      selector: 'link[rel=\"author\"]',\n      attribute: 'href'\n    }\n  ],\n  text: [\n    {\n      selector: '.section-content',\n      text: true\n    }\n  ]\n};\n\nconst url = 'https://medium.com/the-node-js-collection/native-extensions-for-node-js-767e221b3d26';\n\noembedder(url, { selectors })\n  .then(console.log)\n  .catch(console.log);\n```\n\n#### Http options\n\nThe configuration of the module allows the user to set some information of the http GET request. The allowed options are the following:\n\n| http option    | Default value | Description                                                                                 |\n| -------------- | ------------- | ------------------------------------------------------------------------------------------- |\n| encoding       | `utf-8`       | The encoding to be used by the request                                                      |\n| followRedirect | `true`        | To follow or not `3xx` responses as redirects                                               |\n| gzip           | `true`        | Requests compressed content or not                                                          |\n| headers        | `undefined`   | A JS object with [http header info](https://github.com/request/request#custom-http-headers) |\n| timeout        |               | After the timeout in `ms` the request will respond with `ESOCKETTIMEDOUT` error             |\n\n##### Example with http options\n\n```js\nconst oembedder = require('oembedder');\n\nconst url = 'https://medium.com/the-node-js-collection/native-extensions-for-node-js-767e221b3d26';\n\nconst httpOptions = {\n  timeout: 5000 // sets the request timeout to 5 seconds\n};\n\noembedder(url, { httpOptions })\n  .then(console.log)\n  .catch(console.log);\n```\n\n## Limitations\n\nAt the moment the library only resolves oEmbeds of type link for the resources that no provider is given or matched.\n\n## License\n\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fdinostheo%2Foembedder.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fdinostheo%2Foembedder?ref=badge_large)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdinostheo%2Foembedder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdinostheo%2Foembedder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdinostheo%2Foembedder/lists"}