mirror of
https://github.com/hpware/news-analyze.git
synced 2025-06-23 21:14:23 +00:00
Add image into the newsView & Update README.md & prettier & update news analzye view.
This commit is contained in:
parent
d4904d18b8
commit
1453132a63
6 changed files with 99 additions and 62 deletions
|
@ -16,7 +16,7 @@ function findTime(timeText: string) {
|
|||
const minutesAgo = parseInt(minuteMatch[1]);
|
||||
return new Date(now.getTime() - minutesAgo * 60 * 1000);
|
||||
}
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -81,11 +81,11 @@ async function lineToday(slug: string) {
|
|||
const orgAuthorDateData = html("span.entityPublishInfo-meta-info").text();
|
||||
const updateMatch = orgAuthorDateData.match(/更新於\s*([^•]+)/);
|
||||
const publishMatch = orgAuthorDateData.match(/發布於\s*(.+)$/);
|
||||
let updatedAt: Date | null = null;
|
||||
let updatedAt: Date | null = null;
|
||||
if (updateMatch) {
|
||||
updatedAt = findTime(updateMatch[1].trim());
|
||||
}
|
||||
let publishedAt: Date | null = null;
|
||||
let publishedAt: Date | null = null;
|
||||
if (publishMatch) {
|
||||
publishedAt = findTime(publishMatch[1].trim());
|
||||
}
|
||||
|
@ -96,7 +96,7 @@ let publishedAt: Date | null = null;
|
|||
author: author,
|
||||
images: images,
|
||||
updateat: updatedAt,
|
||||
publishedat: publishedAt
|
||||
publishedat: publishedAt,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue