feat(route)!: remove kuaibao (#10708)

This commit is contained in:
Tony
2022-09-06 01:35:15 +08:00
committed by GitHub
parent 4e9b596e81
commit 936dc889d9
2 changed files with 0 additions and 39 deletions
-6
View File
@@ -2478,12 +2478,6 @@ column 为 third 时可选的 category:
<Route author="WenryXu" example="/juesheng" path="/juesheng"/>
## 看点快报
### 首页
<Route author="nczitzk" example="/kuaibao" path="/kuaibao/index"/>
## 科技島讀
### 分類
-33
View File
@@ -1,33 +0,0 @@
const got = require('@/utils/got');
module.exports = async (ctx) => {
const currentUrl = 'http://kuaibao.qq.com/n/getKbMainpageInfo';
const response = await got({
method: 'get',
url: currentUrl,
});
const articleList = response.data.newslist.map((item) => ({
title: item.title,
link: `https://kuaibao.qq.com/getSubNewsContent?id=${item.id}&style=json`,
pubDate: new Date(item.time).toUTCString(),
}));
ctx.state.data = {
title: '看点快报 - 首页',
link: 'http://kuaibao.qq.com/',
item: await Promise.all(
articleList.map((item) =>
ctx.cache.tryGet(item.link, async () => {
const contentResponse = await got({
method: 'get',
url: item.link,
});
item.link = contentResponse.data.url || contentResponse.data.short_url;
item.description = contentResponse.data.content.text;
return item;
})
)
),
};
};