O'Reilly logo

Cross-platform Desktop Application Development: Electron, Node, NW.js, and React by Dmitry Sheiko

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating a service to fetch RSS

In a nutshell, our application is about reading RSS feeds. So, it would be the right thing to start with the service, which fetches the feed by a given URL and parses it into a structure that we could attach to the applications state. I suggest retrieving the feed XML with the request (https://www.npmjs.com/package/request) module and parsing it using the feedme module (https://www.npmjs.com/package/feedme). Let's do it first in plain JavaScript. So, we need to install both the packages:

npm i -S feedme
npm i -S request

We are going to have a function rss that uses request to fetch feed contents though HTTP(s). This function will accept two arguments: feed URL and a callback function written in a thunk-like ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required