Fix news parsing when no description is given. #314

This commit is contained in:
Michael Teeuw 2016-05-12 12:30:45 +02:00
parent 3e468d1348
commit 5e0c0137d3

View File

@ -47,7 +47,7 @@ var Fetcher = function(url, reloadInterval, encoding) {
var description = item.description || item.summary || item.content || ''; var description = item.description || item.summary || item.content || '';
var pubdate = item.pubdate || item.published || item.updated; var pubdate = item.pubdate || item.published || item.updated;
if (title && description && pubdate) { if (title && pubdate) {
var regex = /(<([^>]+)>)/ig; var regex = /(<([^>]+)>)/ig;
description = description.replace(regex, ""); description = description.replace(regex, "");
@ -62,6 +62,9 @@ var Fetcher = function(url, reloadInterval, encoding) {
console.log("Can't parse feed item:"); console.log("Can't parse feed item:");
console.log(item); console.log(item);
console.log('Title: ' + title);
console.log('Description: ' + description);
console.log('Pubdate: ' + pubdate);
} }
}); });