From e7647392dc290bdc6d33fb91ccb5885daac9b579 Mon Sep 17 00:00:00 2001 From: mocusez Date: Wed, 11 Dec 2024 01:46:54 +0800 Subject: [PATCH] fix(route/duckdb): change blogs link and author (#17856) * fix(route/duckdb): change blogs link and author * fix(route/duckdb): update description selector --------- --- lib/routes/duckdb/news.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/routes/duckdb/news.ts b/lib/routes/duckdb/news.ts index d4cde64a9f..eece112c56 100644 --- a/lib/routes/duckdb/news.ts +++ b/lib/routes/duckdb/news.ts @@ -36,8 +36,9 @@ async function handler() { item = $(item); return { title: item.find('h3').text().trim(), - link: `https://duckdb.org${item.find('a').eq(2).attr('href')}`, + link: `https://duckdb.org${item.find('a.blocklink').attr('href')}`, pubDate: timezone(parseDate(item.find('.date').text(), 'YYYY-MM-DD'), 0), + author: item.find('.author').text().trim(), }; }); @@ -46,9 +47,7 @@ async function handler() { cache.tryGet(item.link, async () => { const response = await got(item.link); const $ = load(response.body); - item.author = $('.author').text(); - item.description = $('.singleentry').html(); - + item.description = $('.contentwidth').find('h1, .infoline').remove().end().html(); // 上面每个列表项的每个属性都在此重用, // 并增加了一个新属性“description” return item;