Skip to content

Commit

Permalink
feat(route/apnews): Enhance live page post extraction. (#17446)
Browse files Browse the repository at this point in the history
  • Loading branch information
dzx-dzx authored Nov 5, 2024
1 parent cf7ce24 commit 66533f5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/routes/apnews/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,14 @@ export function fetchArticle(item) {
// Live
ldjson = rawLdjson;

const url = new URL(item.link);
const description = url.hash ? $(url.hash).parent().find('.LiveBlogPost-body').html() : ldjson.description;
const pubDate = url.hash ? parseDate(Number.parseInt($(url.hash).parent().attr('data-posted-date-timestamp'), 10)) : parseDate(ldjson.coverageStartTime);

return {
category: ldjson.keywords,
pubDate: parseDate(ldjson.coverageStartTime),
description: ldjson.description,
pubDate,
description,
guid: $("meta[name='brightspot.contentId']").attr('content'),
...item,
};
Expand Down

0 comments on commit 66533f5

Please sign in to comment.