mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-07-12 02:04:40 +00:00
Fix news parsing when no description is given. #314
This commit is contained in:
parent
3e468d1348
commit
5e0c0137d3
@ -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);
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user