Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
dzx-dzx committed May 3, 2024
1 parent 8139cff commit 916222d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/routes/scmp/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ export const parseItem = async (item) => {
item.updated = parseDate(article.updatedDate, 'x');
item.category = [...new Set([...article.topics.map((t) => t.name), ...article.sections.flatMap((t) => t.value.map((v) => v.name)), ...article.keywords.map((k) => k?.split(', '))])];

item.enclosure_length = item.enclosure.length;
item.enclosure_url = item.enclosure.url;
item.enclosure_type = item.enclosure.type;

// N.B. gallery in article is not rendered
// e.g., { type: 'div', attribs: { class: 'scmp-photo-gallery', 'data-gallery-nid': '3239409' }}
// from https://www.scmp.com/news/china/politics/article/3239355/li-keqiang-former-premier-china-dead
Expand Down

0 comments on commit 916222d

Please sign in to comment.