How to use the popsicle.plugins.parse function in popsicle

To help you get started, we’ve selected a few popsicle 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 blakeembrey / node-scrappy / src / scrapers / html.ts View on Github external
.then(function (result) {
      const resolve: Array> = []

      // Attach OEmbed information to entry.
      if (options.useOEmbed !== false) {
        if (oembedJsonUrl) {
          const req = get({
            url: oembedJsonUrl,
            headers: {
              'User-Agent': options.userAgent
            }
          })
            .use(status(200))
            .use(plugins.parse('json'))
            .then(
              (res) => {
                result.oembed = res.body
              },
              () => {/* Noop request/response errors. */}
            )

          resolve.push(req)
        }
      }

      if (options.fallbackOnFavicon !== false) {
        if (result.html && result.html.icons == null) {
          const faviconUrl = resolveUrl(contentUrl, '/favicon.ico')

          const req = get({