feat(route): add 不良林 (#14479)
* 增加几个自己用的路由 * 创建 maintainer.js * 更新 maintainer.js * 更新 freeadaycom.js * 增加 不良林 * 更新 radar.js * style: auto format * 重新调整路径 几次PR都不通过,参照一个通过的调整了路径 * 根据要求进行了修改 * 更新 blog.mdx * 更新 blog.mdx --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This commit is contained in:
parent
af8217575e
commit
1a7d07d3fc
|
|
@ -0,0 +1,32 @@
|
|||
const { parseDate } = require('@/utils/parse-date');
|
||||
const got = require('@/utils/got');
|
||||
const cheerio = require('cheerio');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const url = 'https://bulianglin.com/';
|
||||
const response = await got({ method: 'get', url });
|
||||
const $ = cheerio.load(response.data);
|
||||
|
||||
const list = $('div.single-post')
|
||||
.map((i, e) => {
|
||||
const element = $(e);
|
||||
const title = element.find('h2 > a').text();
|
||||
const link = element.find('h2 > a').attr('href');
|
||||
const description = element.find('p.summary').text();
|
||||
const dateraw = element.find('div.text-muted').find('li').eq(1).text();
|
||||
|
||||
return {
|
||||
title,
|
||||
description,
|
||||
link,
|
||||
pubDate: parseDate(dateraw, 'YYYY 年 MM 月 DD 日'),
|
||||
};
|
||||
})
|
||||
.get();
|
||||
|
||||
ctx.state.data = {
|
||||
title: '不良林',
|
||||
link: url,
|
||||
item: list,
|
||||
};
|
||||
};
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
module.exports = {
|
||||
'/': ['cnkmmk'],
|
||||
};
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
module.exports = {
|
||||
'bulianglin.com': {
|
||||
_name: '不良林',
|
||||
'.': [
|
||||
{
|
||||
title: '博客',
|
||||
docs: 'https://docs.rsshub.app/routes/blog#bu-liang-lin',
|
||||
source: ['/'],
|
||||
target: '/bulianglin',
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
module.exports = function (router) {
|
||||
router.get('/', require('./bulianglin'));
|
||||
};
|
||||
|
|
@ -276,6 +276,12 @@
|
|||
|
||||
<Route author="hujingnb" example="/cnblogs/pick" path="/cnblogs/pick" radar="1" />
|
||||
|
||||
## 不良林 {#bu-liang-lin}
|
||||
|
||||
### 博客 {#bu-liang-lin-bo-ke}
|
||||
|
||||
<Route author="cnkmmk" example="/bulianglin" path="/bulianglin" radar="1" />
|
||||
|
||||
## 财新博客 {#cai-xin-bo-ke}
|
||||
|
||||
### 用户博客 {#cai-xin-bo-ke-yong-hu-bo-ke}
|
||||
|
|
|
|||
Loading…
Reference in New Issue