fix(route): 华尔街见闻移除广告 (#10913)

This commit is contained in:
Ethan Shen 2022-09-27 02:06:35 +08:00 committed by GitHub
parent 41ec834396
commit 5907eca04b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 6 deletions

View File

@ -28,12 +28,14 @@ module.exports = async (ctx) => {
url: apiUrl,
});
let items = response.data.data.items.map((item) => ({
type: item.resource_type,
guid: item.resource.id,
link: item.resource.uri,
pubDate: parseDate(item.resource.display_time * 1000),
}));
let items = response.data.data.items
.filter((item) => item.resource_type !== 'ad')
.map((item) => ({
type: item.resource_type,
guid: item.resource.id,
link: item.resource.uri,
pubDate: parseDate(item.resource.display_time * 1000),
}));
items = await Promise.all(
items.map((item) =>