From 37404f280a7a9b840c2c7fd49053a12190859f74 Mon Sep 17 00:00:00 2001 From: Andvari <31068367+dzx-dzx@users.noreply.github.com> Date: Sun, 3 Sep 2023 03:01:39 +0800 Subject: [PATCH] feat(route): Add request throttling for news.cn (#13191) --- lib/v2/news/whxw.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/v2/news/whxw.js b/lib/v2/news/whxw.js index 9d667af21..771b0f2cd 100644 --- a/lib/v2/news/whxw.js +++ b/lib/v2/news/whxw.js @@ -15,6 +15,7 @@ module.exports = async (ctx) => { let items = $('h3 a') .toArray() + .slice(0, ctx.query.limit ? parseInt(ctx.query.limit) : 100) .map((item) => { item = $(item); return {