diff --git a/lib/v2/jiaoliudao/index.js b/lib/v2/jiaoliudao/index.js new file mode 100644 index 00000000000000..b8fc63e626f17c --- /dev/null +++ b/lib/v2/jiaoliudao/index.js @@ -0,0 +1,26 @@ +const got = require('@/utils/got'); +const { parseDate } = require('@/utils/parse-date'); + +module.exports = async (ctx) => { + const baseUrl = 'https://www.jiaoliudao.com'; + const { data } = await got(`${baseUrl}/wp-json/wp/v2/posts`, { + searchParams: { + per_page: ctx.query.limit ? parseInt(ctx.query.limit, 10) : 30, + }, + }); + + const items = data.map((item) => ({ + title: item.title.rendered, + description: item.content.rendered, + pubDate: parseDate(item.date_gmt), + updated: parseDate(item.modified_gmt), + link: item.link, + })); + + ctx.state.data = { + title: '交流岛资源网-专注网络资源收集', + image: `${baseUrl}/favicon.ico`, + link: baseUrl, + item: items, + }; +}; diff --git a/lib/v2/jiaoliudao/maintainer.js b/lib/v2/jiaoliudao/maintainer.js new file mode 100644 index 00000000000000..83fc5ed48db85a --- /dev/null +++ b/lib/v2/jiaoliudao/maintainer.js @@ -0,0 +1,3 @@ +module.exports = { + '/': ['TonyRL'], +}; diff --git a/lib/v2/jiaoliudao/radar.js b/lib/v2/jiaoliudao/radar.js new file mode 100644 index 00000000000000..2969a54bdf5080 --- /dev/null +++ b/lib/v2/jiaoliudao/radar.js @@ -0,0 +1,13 @@ +module.exports = { + 'jiaoliudao.com': { + _name: '交流岛资源网', + '.': [ + { + title: '最新文章', + docs: 'https://docs.rsshub.app/routes/blog#jiao-liu-dao-zi-yuan-wang', + source: ['/'], + target: '/jiaoliudao', + }, + ], + }, +}; diff --git a/lib/v2/jiaoliudao/router.js b/lib/v2/jiaoliudao/router.js new file mode 100644 index 00000000000000..7e427447c70050 --- /dev/null +++ b/lib/v2/jiaoliudao/router.js @@ -0,0 +1,3 @@ +module.exports = (router) => { + router.get('/', require('./index')); +}; diff --git a/website/docs/routes/blog.mdx b/website/docs/routes/blog.mdx index 51dae7bcd4a577..04ef21213bdf59 100644 --- a/website/docs/routes/blog.mdx +++ b/website/docs/routes/blog.mdx @@ -360,6 +360,12 @@ | drama\_deep | drama\_rating | drama\_column | drama\_interactive | +## 交流岛资源网 {#jiao-liu-dao-zi-yuan-wang} + +### 最新文章 {#jiao-liu-dao-zi-yuan-wang-zui-xin-wen-zhang} + + + ## 敬维博客 {#jing-wei-bo-ke} ### 文章 {#jing-wei-bo-ke-wen-zhang}