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:
parent
f051fbd1e1
commit
9104b4200a
@ -35,22 +35,18 @@ function FeedParseNode(n) {
|
|||||||
node.error(error);
|
node.error(error);
|
||||||
})
|
})
|
||||||
.on('meta', function (meta) {})
|
.on('meta', function (meta) {})
|
||||||
.on('article', function (article) {
|
.on('readable', function () {
|
||||||
if (!(article.guid in node.seen) || ( node.seen[article.guid] != 0 && node.seen[article.guid] != article.date.getTime())) {
|
var stream = this, article;
|
||||||
node.seen[article.guid] = article.date?article.date.getTime():0;
|
while (article = stream.read()) {
|
||||||
var msg = {
|
if (!(article.guid in node.seen) || ( node.seen[article.guid] != 0 && node.seen[article.guid] != article.date.getTime())) {
|
||||||
topic:article.origlink||article.link,
|
node.seen[article.guid] = article.date?article.date.getTime():0;
|
||||||
payload: article.description,
|
var msg = {
|
||||||
article: {
|
topic:article.origlink||article.link,
|
||||||
summary:article.summary,
|
payload: article.description,
|
||||||
link:article.link,
|
article: article
|
||||||
date: article.date,
|
};
|
||||||
pubdate: article.pubdate,
|
node.send(msg);
|
||||||
author: article.author,
|
}
|
||||||
guid: article.guid,
|
|
||||||
}
|
|
||||||
};
|
|
||||||
node.send(msg);
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.on('end', function () {
|
.on('end', function () {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user