diff --git a/lib/v2/huggingface/daily-papers.js b/lib/v2/huggingface/daily-papers.js index af9fb54136..53bbafe36c 100644 --- a/lib/v2/huggingface/daily-papers.js +++ b/lib/v2/huggingface/daily-papers.js @@ -7,13 +7,16 @@ module.exports = async (ctx) => { const $ = cheerio.load(response); const papers = $('main > div[data-target="DailyPapers"]').data('props'); - const items = papers.dailyPapers.map((item) => ({ - title: item.title, - link: `https://arxiv.org/abs/${item.paper.id}`, - description: item.paper.summary.replaceAll('\n', ' '), - pubDate: parseDate(item.publishedAt), - author: item.paper.authors.map((author) => author.name).join(', '), - })); + const items = papers.dailyPapers + .map((item) => ({ + title: item.title, + link: `https://arxiv.org/abs/${item.paper.id}`, + description: item.paper.summary.replaceAll('\n', ' '), + pubDate: parseDate(item.publishedAt), + author: item.paper.authors.map((author) => author.name).join(', '), + upvotes: item.paper.upvotes, + })) + .sort((a, b) => b.upvotes - a.upvotes); ctx.state.data = { title: 'Huggingface Daily Papers',