fix(route): Sputnik News Pubdate (#10820)

This commit is contained in:
Ethan Shen 2022-09-18 08:33:08 +08:00 committed by GitHub
parent 647328222a
commit 1400df76cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -70,6 +70,8 @@ module.exports = async (ctx) => {
const content = cheerio.load(detailResponse.data);
item.pubDate = parseDate(content('a[data-unixtime]').attr('data-unixtime') * 1000);
item.category = content('.tag__text')
.toArray()
.map((tag) => content(tag).text());
@ -78,7 +80,6 @@ module.exports = async (ctx) => {
content('div[data-type="article"]').remove();
item.description = content('.article').html();
item.pubDate = parseDate(content('div[itemprop="datePublished"]').attr('data-unixtime'));
return item;
})