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:
SunBK201 2023-02-08 20:44:37 +08:00 committed by GitHub
parent cec2bd2fe1
commit 1e83e7ddc1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 45 additions and 0 deletions

View File

@ -95,6 +95,12 @@ pageClass: routes
</Route>
## ACG17
### 全部文章
<Route author="SunBK201" example="/acg17/post/all" path="/acg17/post/all" radar="1" />
## AGE 动漫
### 最近更新

View File

@ -0,0 +1,3 @@
module.exports = {
'/post/all': ['SunBK201'],
};

20
lib/v2/acg17/post.js Normal file
View File

@ -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,
})),
};
};

13
lib/v2/acg17/radar.js Normal file
View File

@ -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',
},
],
},
};

3
lib/v2/acg17/router.js Normal file
View File

@ -0,0 +1,3 @@
module.exports = (router) => {
router.get('/post/all', require('./post'));
};