fix(route): BullionVault Gold News (#19962)

This commit is contained in:
Ethan Shen
2025-09-04 13:28:02 +08:00
committed by GitHub
parent d8dd83c266
commit 3647993b68
+3 -3
View File
@@ -21,7 +21,7 @@ export const handler = async (ctx: Context): Promise<Data> => {
let items: DataItem[] = [];
items = $('section#block-views-latest-articles-block div.media, section#block-system-main table.views-table tr')
items = $('section#block-bootstrap-views-block-latest-articles-block div.media, div.gold-news-content table tr')
.slice(0, limit)
.toArray()
.map((el): Element => {
@@ -66,8 +66,8 @@ export const handler = async (ctx: Context): Promise<Data> => {
const detailResponse = await ofetch(item.link);
const $$: CheerioAPI = load(detailResponse);
const title: string = $$('header h1').text();
const description: string | undefined = $$('div[property="content:encoded"]').html() ?? '';
const title: string = $$('article.article h1').text();
const description: string | undefined = $$('div.content').html() ?? '';
const pubDateStr: string | undefined = $$('div.submitted').text().split(/,/).pop();
const categories: string[] = $$('meta[name="news_keywords"]').attr('content')?.split(/,/) ?? [];
const authorEls: Element[] = $$('div.view-author-bio').toArray();