Skip to content

Commit

Permalink
fix: recover jiaoliudao
Browse files Browse the repository at this point in the history
  • Loading branch information
TonyRL authored Jan 15, 2024
1 parent 1f2e823 commit cd54cbc
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 0 deletions.
26 changes: 26 additions & 0 deletions lib/v2/jiaoliudao/index.js
Original file line number Diff line number Diff line change
@@ -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,
};
};
3 changes: 3 additions & 0 deletions lib/v2/jiaoliudao/maintainer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
'/': ['TonyRL'],
};
13 changes: 13 additions & 0 deletions lib/v2/jiaoliudao/radar.js
Original file line number Diff line number Diff line change
@@ -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',
},
],
},
};
3 changes: 3 additions & 0 deletions lib/v2/jiaoliudao/router.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = (router) => {
router.get('/', require('./index'));
};
6 changes: 6 additions & 0 deletions website/docs/routes/blog.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,12 @@
| drama\_deep | drama\_rating | drama\_column | drama\_interactive |
</Route>

## 交流岛资源网 {#jiao-liu-dao-zi-yuan-wang}

### 最新文章 {#jiao-liu-dao-zi-yuan-wang-zui-xin-wen-zhang}

<Route author="TonyRL" example="/jiaoliudao" path="/jiaoliudao" radar="1" />

## 敬维博客 {#jing-wei-bo-ke}

### 文章 {#jing-wei-bo-ke-wen-zhang}
Expand Down

0 comments on commit cd54cbc

Please sign in to comment.