I am trying to parse rss feed in my React application (in componentDidMount). I've looked at multiple js libraries that do this but they all work on the server side. Does anyone know npm packages that work on the client side? Or is it easier for me to write my own function that does the parsing?
Using 'rss-parser' as mentioned, this worked for me:
let parser = new Parser();
const CORS_PROXY = "<some cors proxy>";
(async () => {
let feed = await parser.parseURL(CORS_PROXY + this.props.url);
feed.items.forEach(item => {
console.log(item);
});
})();
npm rss-parser
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With