Node.js module for parsing RSS and ATOM feeds into a common article object.
This module is forked from feed-read npm module. It aims to fix old bugs in the forked version.
$ npm install feed-read-parser
var feed = require("feed-read-parser");
Fetch a feed.
feed("http://craphound.com/?feed=rss2", function(err, articles) {
if (err) throw err;
// Each article has the following properties:
//
// * "title" - The article title (String).
// * "author" - The author's name (String).
// * "link" - The original article link (String).
// * "content" - The HTML content of the article (String).
// * "published" - The date that the article was published (Date).
// * "feed" - {name, source, link}
//
});
Fetch several feeds thanks to a given array
var rss = [
'http://www.eurogamer.net/?format=rss',
'http://fr.ign.com/feed.xml',
'http://www.gamekult.com/feeds/actu.html'
]
feed(rss, function(err, articles) {
if (err) throw err;
// articles is an array of article with properties described above.
});
Parse a string of XML as RSS.
The callback receives (err, articles)
.
Parse a string of XML as ATOM.
The callback receives (err, articles)
.
Identify what type of feed the XML represents.
Returns false
when it is neither RSS or ATOM.
See LICENSE.