fix: remove new ads for ftchinese.com (#1587)

This commit is contained in:
Henry Wang
2019-02-20 03:03:55 +00:00
committed by DIYgod
parent 87f60198b2
commit 18d5a70b87

View File

@@ -27,7 +27,7 @@ const ProcessFeed = ($, link) => {
author = author.trim();
// 去除头部主题, 头部重复标题, 冗余元数据, 植入广告, 植入 js, 社交分享按钮, 底部版权声明, 空白 DOM
content.find('div.story-theme, h1.story-headline, div.story-byline, div.mpu-container-instory,script, div#story-action-placeholder, div.copyrightstatement-container, div.clearfloat').each((i, e) => {
content.find('div.story-theme, h1.story-headline, div.story-byline, div.mpu-container-instory,script, div#story-action-placeholder, div.copyrightstatement-container, div.clearfloat, div.o-ads').each((i, e) => {
$(e).remove();
});
content = content.html();
@@ -57,10 +57,7 @@ const getData = async ({ site = 'www', channel }) => {
const items = await Promise.all(
feed.items.splice(0, 10).map(async (item) => {
const response = await axios({
method: 'get',
url: `${item.link}?full=y&archive`,
});
const response = await axios.get(`${item.link}?full=y&archive`);
const $ = cheerio.load(response.data);
const result = ProcessFeed($, item.link);