-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 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
- Loading branch information
1 parent
5a94d72
commit 0a909ec
Showing
5 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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, | ||
}; | ||
|
||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
'/': ['ruoshui9527'], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
module.exports = { | ||
'onehu.xyz': { | ||
_name: '我不是盐神', | ||
'.': [ | ||
{ | ||
title: '我不是盐神', | ||
docs: 'https://docs.rsshub.app/routes/new-media#wo-bu-shi-yan-shen', | ||
}, | ||
], | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = function (router) { | ||
router.get('/', require('./common')); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters