const got = require('@/utils/got');
const { parseDate } = require('@/utils/parse-date');
module.exports = async (ctx) => {
const api_url = `https://sspai.com/api/v1/topics?offset=0&limit=20&include_total=false`;
const resp = await got({
method: 'get',
url: api_url,
});
const data = resp.data.list;
const items = await Promise.all(
data.map((item) => {
const link = `https://sspai.com/topic/${item.id}`;
let description = '';
const key = `sspai:topics:${item.id}`;
return ctx.cache.tryGet(key, () => {
description = `${item.intro}
如有兴趣,请复制链接订阅