diff --git a/docs/anime.md b/docs/anime.md index 67676ed61..4000835d7 100644 --- a/docs/anime.md +++ b/docs/anime.md @@ -95,6 +95,12 @@ pageClass: routes +## ACG17 + +### 全部文章 + + + ## AGE 动漫 ### 最近更新 diff --git a/lib/v2/acg17/maintainer.js b/lib/v2/acg17/maintainer.js new file mode 100644 index 000000000..37de00b71 --- /dev/null +++ b/lib/v2/acg17/maintainer.js @@ -0,0 +1,3 @@ +module.exports = { + '/post/all': ['SunBK201'], +}; diff --git a/lib/v2/acg17/post.js b/lib/v2/acg17/post.js new file mode 100644 index 000000000..c5555a67a --- /dev/null +++ b/lib/v2/acg17/post.js @@ -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, + })), + }; +}; diff --git a/lib/v2/acg17/radar.js b/lib/v2/acg17/radar.js new file mode 100644 index 000000000..54d223116 --- /dev/null +++ b/lib/v2/acg17/radar.js @@ -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', + }, + ], + }, +}; diff --git a/lib/v2/acg17/router.js b/lib/v2/acg17/router.js new file mode 100644 index 000000000..328b29356 --- /dev/null +++ b/lib/v2/acg17/router.js @@ -0,0 +1,3 @@ +module.exports = (router) => { + router.get('/post/all', require('./post')); +};