mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-07-10 17:24:44 +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 pubdate = item.pubdate || item.published || item.updated;
|
||||
|
||||
if (title && description && pubdate) {
|
||||
if (title && pubdate) {
|
||||
|
||||
var regex = /(<([^>]+)>)/ig;
|
||||
description = description.replace(regex, "");
|
||||
@ -62,7 +62,10 @@ var Fetcher = function(url, reloadInterval, encoding) {
|
||||
|
||||
console.log("Can't parse feed 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