feat(route): Add request throttling for apnews (#13193)

* feat(route): Add request throttling for apnews

* Update topics.js
This commit is contained in:
Andvari
2023-09-03 22:02:23 +08:00
committed by GitHub
parent c6b5accd43
commit 38e4f1ac50
+1
View File
@@ -12,6 +12,7 @@ module.exports = async (ctx) => {
const items = await Promise.all(
$('.PagePromo-content')
.get()
.slice(0, ctx.query.limit ? parseInt(ctx.query.limit) : Infinity)
.map((e) => ({
title: $(e).find('span.PagePromoContentIcons-text').text(),
link: $(e).find('a').attr('href'),