How to use the oembed-parser.extract function in oembed-parser

To help you get started, we’ve selected a few oembed-parser examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github TryGhost / Ghost / core / server / api / v0.1 / oembed.js View on Github external
function knownProvider(url) {
            return extract(url).catch((err) => {
                return Promise.reject(new common.errors.InternalServerError({
                    message: err.message
                }));
            });
        }
github chadly / ghost / core / server / api / v0.1 / oembed.js View on Github external
function knownProvider(url) {
            return extract(url).catch((err) => {
                return Promise.reject(new common.errors.InternalServerError({
                    message: err.message
                }));
            });
        }
github TryGhost / Ghost / core / server / api / canary / oembed.js View on Github external
function knownProvider(url) {
    return extract(url).catch((err) => {
        return Promise.reject(new common.errors.InternalServerError({
            message: err.message
        }));
    });
}
github TryGhost / Ghost / core / server / api / v2 / oembed.js View on Github external
function knownProvider(url) {
                return extract(url).catch((err) => {
                    return Promise.reject(new common.errors.InternalServerError({
                        message: err.message
                    }));
                });
            }
github ndaidong / article-parser / src / parsers / extensions / youtube.js View on Github external
return new Promise((resolve, reject) => {
      const vid = getYtid(url);

      if (!vid) {
        throw new Error('No video ID found');
      }

      url = `https://www.youtube.com/watch?v=${vid}`;

      return extract(url).then((data) => {
        return {
          vid,
          title: data.title,
          canonicals: [
            url,
            `https://youtu.be/${vid}`,
            `https://www.youtube.com/v/${vid}`,
            `https://www.youtube.com/embed/${vid}`,
          ],
          content: ``,
          author: data.author_name,
          source: data.provider_name,
          image: data.thumbnail_url,
        };
      }).then((art) => {
        return getDuration(art.vid).then((duration) => {

oembed-parser

Get oEmbed data from given URL.

MIT
Latest version published 2 years ago

Package Health Score

57 / 100
Full package analysis