feat(route): add acg17 rss (#11803)
* feat(route): add acg17 rss * fix * fix link * use wordpress api * use date_gmt instead * fix host url * not use cache
This commit is contained in:
parent
cec2bd2fe1
commit
1e83e7ddc1
|
|
@ -95,6 +95,12 @@ pageClass: routes
|
|||
|
||||
</Route>
|
||||
|
||||
## ACG17
|
||||
|
||||
### 全部文章
|
||||
|
||||
<Route author="SunBK201" example="/acg17/post/all" path="/acg17/post/all" radar="1" />
|
||||
|
||||
## AGE 动漫
|
||||
|
||||
### 最近更新
|
||||
|
|
|
|||
|
|
@ -0,0 +1,3 @@
|
|||
module.exports = {
|
||||
'/post/all': ['SunBK201'],
|
||||
};
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
const got = require('@/utils/got');
|
||||
const { parseDate } = require('@/utils/parse-date');
|
||||
|
||||
const host = 'http://acg17.com';
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const response = await got(`${host}/wp-json/wp/v2/posts?per_page=30`);
|
||||
const list = response.data;
|
||||
ctx.state.data = {
|
||||
title: `ACG17 - 全部文章`,
|
||||
link: `${host}/blog`,
|
||||
description: 'ACG17 - 全部文章',
|
||||
item: list.map((item) => ({
|
||||
title: item.title.rendered,
|
||||
link: item.link,
|
||||
pubDate: parseDate(item.date_gmt),
|
||||
description: item.content.rendered,
|
||||
})),
|
||||
};
|
||||
};
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
module.exports = {
|
||||
'acg17.com': {
|
||||
_name: 'ACG17',
|
||||
'.': [
|
||||
{
|
||||
title: '全部文章',
|
||||
docs: 'https://docs.rsshub.app/anime.html#acg17',
|
||||
source: ['/post'],
|
||||
target: '/acg17/post/all',
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
module.exports = (router) => {
|
||||
router.get('/post/all', require('./post'));
|
||||
};
|
||||
Loading…
Reference in New Issue