Files
RSSHub/lib/v2/foresightnews/index.js
T
Ethan Shen 4b38c35395 fix(route): Foresight News (#13026)
* fix(route): Foresight News

* fix docs

* fix tags

* fix index items

---------
2023-08-16 23:15:35 +08:00

23 lines
620 B
JavaScript

const { rootUrl, apiRootUrl, processItems, icon, image } = require('./util');
module.exports = async (ctx) => {
const limit = ctx.query.limit ? parseInt(ctx.query.limit, 10) : 50;
const apiUrl = new URL(`v2/feed`, apiRootUrl).href;
const { items } = await processItems(apiUrl, limit);
ctx.state.data = {
item: items,
title: 'Foresight News - 精选资讯',
link: rootUrl,
description: 'FN精选 - Foresight News',
language: 'zh-cn',
image,
icon,
logo: icon,
subtitle: '精选资讯',
author: 'Foresight News',
};
};