fix: handle 9to5 missing cover photo (#1544)

This commit is contained in:
Henry Wang
2019-02-19 11:25:48 +08:00
committed by DIYgod
parent c9e9c06a7e
commit bf1ca4d8b9
+5
View File
@@ -4,6 +4,11 @@ const ProcessFeed = (data) => {
const $ = cheerio.load(data);
const content = $('div[itemprop="articleBody"]');
const cover = $('meta[property="og:image"]');
if (cover.length > 0) {
$(`<img src=${cover[0].attribs.content}>`).insertBefore(content[0].firstChild);
}
// remove useless DOMs
content
.find('hr')