1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Update feedparser node for underlying module api changes

This commit is contained in:
Nicholas O'Leary 2013-11-24 16:01:52 +00:00
parent f051fbd1e1
commit 9104b4200a

View File

@ -35,23 +35,19 @@ function FeedParseNode(n) {
node.error(error); node.error(error);
}) })
.on('meta', function (meta) {}) .on('meta', function (meta) {})
.on('article', function (article) { .on('readable', function () {
var stream = this, article;
while (article = stream.read()) {
if (!(article.guid in node.seen) || ( node.seen[article.guid] != 0 && node.seen[article.guid] != article.date.getTime())) { if (!(article.guid in node.seen) || ( node.seen[article.guid] != 0 && node.seen[article.guid] != article.date.getTime())) {
node.seen[article.guid] = article.date?article.date.getTime():0; node.seen[article.guid] = article.date?article.date.getTime():0;
var msg = { var msg = {
topic:article.origlink||article.link, topic:article.origlink||article.link,
payload: article.description, payload: article.description,
article: { article: article
summary:article.summary,
link:article.link,
date: article.date,
pubdate: article.pubdate,
author: article.author,
guid: article.guid,
}
}; };
node.send(msg); node.send(msg);
} }
}
}) })
.on('end', function () { .on('end', function () {
}); });