Skip to content

Commit

Permalink
fix(route/duckdb): change blogs link and author (DIYgod#17856)
Browse files Browse the repository at this point in the history
* fix(route/duckdb): change blogs link and author

* fix(route/duckdb): update description selector

---------
  • Loading branch information
mocusez authored Dec 10, 2024
1 parent d93568f commit e764739
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/routes/duckdb/news.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
};
});

Expand All @@ -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;
Expand Down

0 comments on commit e764739

Please sign in to comment.