|
|
|
@ -335,11 +335,14 @@ function onLoadDOM(dom) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (outputJSON){
|
|
|
|
|
var result = {};
|
|
|
|
|
for (propkey in wantedProperties) {
|
|
|
|
|
let prop = wantedProperties[propkey];
|
|
|
|
|
let result = {};
|
|
|
|
|
const allprops = ["title", "excerpt", "byline", "length", "dir", "textContent"];
|
|
|
|
|
for (propkey in allprops) {
|
|
|
|
|
let prop = allprops[propkey];
|
|
|
|
|
result[prop] = article[prop];
|
|
|
|
|
}
|
|
|
|
|
result["htmlContent"] = article.content;
|
|
|
|
|
result["htmlTitle"] = `<h1>${escapeHTML(article.title, document)}</h1>`
|
|
|
|
|
writeStream.write(JSON.stringify(result));
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|