Code Monkey home page Code Monkey logo

Comments (4)

ndaidong avatar ndaidong commented on May 27, 2024 1

@0x1017 you can use parserOptions parameter to customize the output.

For example, if you turn off normalization, you can get the raw result, with full description:

  const feed = await extract('https://www.historyinmemes.com/feed', {
    normalization: false,
  })
  console.log(feed)

If you still want to normalize feed data, let's use getExtraEntryFields to modify only description as below:

  const feed = await extract(url, {
    getExtraEntryFields: (feedEntry) => {
      const { description } = feedEntry
      // you can do anything with the description here
      return {
        description,
      }
    },
  })
  console.log(feed)

from feed-extractor.

kk7771 avatar kk7771 commented on May 27, 2024

@neizod
Hi!
First and foremost, thanks for your work!
Ask another question.

https://www.historyinmemes.com/feed

This feed link actually has body content, but the feed extractor only displays a thumbnail text. How can this format be displayed in its entirety? Can you help me?

image

image

from feed-extractor.

LavaCxx avatar LavaCxx commented on May 27, 2024

Even though I turned off normalization, the parsing of links still changed.
image

from feed-extractor.

LavaCxx avatar LavaCxx commented on May 27, 2024

After some research, I found that the problem is in the fast-xml-parser. Maybe the previous xml didn't support the & character, so this problem wasn't considered?
Anyway, if anyone else encounters this problem in the future, they can refer to this code.

await extract(url, {
    normalization: false, xmlParserOptions: {
        tagValueProcessor: (tagName, tagValue) => {
            if (tagName === 'link') return tagValue.replace(/&/g, '&')
            return tagValue
        }
    }
})

from feed-extractor.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.