Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the best way to generate an atom or rss feed in node.js application

I'm trying to add newsfeeds to an node.js application using express.js and I can't find a painless way to take a json model and turn it into an atom or rss feed. Best solutions i've come up with is use an Xml library (also not so hot on node.js) or EJS template and build it up by hand.

There seems to be plenty of code for parsing rss/atom into json, but not for going the other direction. Am I missing something?

like image 315
Arne Claassen Avatar asked Sep 01 '11 18:09

Arne Claassen


2 Answers

Searching the NPM registery for RSS

gives rss

See their github page for more details.

As general advice, do search the npm registry for relevant keywords. It'll make your life easier.

like image 94
Raynos Avatar answered Sep 29 '22 18:09

Raynos


You can use Feed for Node.js. It is a very simple wrapper that I created a couple of weeks ago to generate some Atom and RSS feed in no time.

Simply install it using NPM:

$ npm install feed

Then, follow the documentation available there http://projets.jpmonette.net/en/feed !

like image 42
jpmonette Avatar answered Sep 29 '22 18:09

jpmonette