diff --git a/lib/v2/apnews/topics.js b/lib/v2/apnews/topics.js index 573fb2baf5d78c..1ac0d36b69bb2f 100644 --- a/lib/v2/apnews/topics.js +++ b/lib/v2/apnews/topics.js @@ -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'),