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:
ruoshui9527 2024-02-02 23:47:52 +08:00 committed by GitHub
parent 5a94d72ae5
commit 0a909ecd93
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 50 additions and 0 deletions

27
lib/v2/onehu/common.js Normal file
View File

@ -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,
};
};

View File

@ -0,0 +1,3 @@
module.exports = {
'/': ['ruoshui9527'],
};

11
lib/v2/onehu/radar.js Normal file
View File

@ -0,0 +1,11 @@
module.exports = {
'onehu.xyz': {
_name: '我不是盐神',
'.': [
{
title: '我不是盐神',
docs: 'https://docs.rsshub.app/routes/new-media#wo-bu-shi-yan-shen',
},
],
},
};

3
lib/v2/onehu/router.js Normal file
View File

@ -0,0 +1,3 @@
module.exports = function (router) {
router.get('/', require('./common'));
};

View File

@ -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" />