feat(route): add 我不是盐神 (#14348)
* Create common.js * Create maintainer.js * Create router.js * Create radar.js * Update common.js A space is add after ','. * Update common.js A space is add after ','. * Update common.js * Update radar.js * Update new-media.mdx * Update maintainer.js * Update radar.js * Update radar.js * Update radar.js
This commit is contained in:
parent
5a94d72ae5
commit
0a909ecd93
|
|
@ -0,0 +1,27 @@
|
|||
const got = require('@/utils/got');
|
||||
const cheerio = require('cheerio');
|
||||
const timezone = require('@/utils/timezone');
|
||||
const { parseDate } = require('@/utils/parse-date');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const link = 'https://onehu.xyz';
|
||||
const response = await got(link);
|
||||
const data = response.data;
|
||||
const $ = cheerio.load(data);
|
||||
const list = $('#board article').toArray().map((item) => {
|
||||
item = $(item);
|
||||
return {
|
||||
title: item.find('.index-header').text(),
|
||||
link: item.find('.index-header').children('a').attr('href'),
|
||||
description: item.find('.index-excerpt.index-excerpt__noimg').children('div').text(),
|
||||
pubDate: timezone(parseDate(item.find('.post-meta.mr-3').children('time').attr('datetime'), 'YYYY年MM月DD日 HH:mm'), +8),
|
||||
};
|
||||
});
|
||||
|
||||
ctx.state.data = {
|
||||
title: $('title').text(),
|
||||
link,
|
||||
item: list,
|
||||
};
|
||||
|
||||
};
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
module.exports = {
|
||||
'/': ['ruoshui9527'],
|
||||
};
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
module.exports = {
|
||||
'onehu.xyz': {
|
||||
_name: '我不是盐神',
|
||||
'.': [
|
||||
{
|
||||
title: '我不是盐神',
|
||||
docs: 'https://docs.rsshub.app/routes/new-media#wo-bu-shi-yan-shen',
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
module.exports = function (router) {
|
||||
router.get('/', require('./common'));
|
||||
};
|
||||
|
|
@ -5288,3 +5288,9 @@
|
|||
### 公众号 {#zi-you-wei-xin-gong-zhong-hao}
|
||||
|
||||
<Route author="TonyRL" example="/freewechat/profile/MzI5NTUxNzk3OA==" path="/freewechat/profile/:id" paramsDesc={['公众号 ID,可在URL中找到']} radar="1" anticrawler="1" />
|
||||
|
||||
## 我不是盐神 {#wo-bu-shi-yan-shen}
|
||||
|
||||
### 首页 {#wo-bu-shi-yan-shen-shou-ye}
|
||||
|
||||
<Route author="ruoshui9527" example="/onehu" path="/onehu" />
|
||||
|
|
|
|||
Loading…
Reference in New Issue