fix(route/bullionvault): missing latest articles (#18754)

This commit is contained in:
Ethan Shen
2025-04-02 00:49:19 +08:00
committed by GitHub
parent a4935ea1ac
commit b9a71029f3
+3 -3
View File
@@ -20,15 +20,15 @@ export const handler = async (ctx: Context): Promise<Data> => {
let items: DataItem[] = [];
items = $('div.gold-news-content div.view-content table.views-table tbody tr')
items = $('section#block-views-latest-articles-block div.media, section#block-system-main table.views-table tr')
.slice(0, limit)
.toArray()
.map((el): Element => {
const $el: Cheerio<Element> = $(el);
const $aEl: Cheerio<Element> = $el.find('td.views-field-title a').first();
const $aEl: Cheerio<Element> = $el.find('td.views-field-title a, div.views-field-title a').first();
const title: string = $aEl.text();
const pubDateStr: string | undefined = $el.find('td.views-field-created').text().trim();
const pubDateStr: string | undefined = $el.find('td.views-field-created, div.views-field-created').text().trim();
const linkUrl: string | undefined = $aEl.attr('href');
const authorEls: Element[] = $el.find('a.username').toArray();
const authors: DataItem['author'] = authorEls.map((authorEl) => {