mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-19 06:38:55 +08:00
@@ -736,6 +736,12 @@ GitHub 官方也提供了一些 RSS:
|
||||
|
||||
<route name="最新分享" author="xyqfer" example="/blogread/newest" path="/blogread/newest"/>
|
||||
|
||||
### GitChat
|
||||
|
||||
<route name="最新" author="xyqfer" example="/gitchat/newest" path="/gitchat/newest"/>
|
||||
|
||||
> GitChat 需要付费订阅, RSS 仅做更新提醒, 不含付费内容.
|
||||
|
||||
## 直播
|
||||
|
||||
### 哔哩哔哩直播
|
||||
|
||||
@@ -770,4 +770,7 @@ router.get('/itjuzi/merge', require('./routes/itjuzi/merge'));
|
||||
// 探物
|
||||
router.get('/tanwu/products', require('./routes/tanwu/products'));
|
||||
|
||||
// GitChat
|
||||
router.get('/gitchat/newest', require('./routes/gitchat/newest'));
|
||||
|
||||
module.exports = router;
|
||||
|
||||
38
routes/gitchat/newest.js
Normal file
38
routes/gitchat/newest.js
Normal file
@@ -0,0 +1,38 @@
|
||||
const axios = require('../../utils/axios');
|
||||
const cheerio = require('cheerio');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const response = await axios({
|
||||
method: 'get',
|
||||
url: 'https://gitbook.cn/gitchat/news/0/20?searchKey=',
|
||||
});
|
||||
const $ = cheerio.load(response.data.data);
|
||||
const resultItem = $('.col-md-12')
|
||||
.map((index, item) => {
|
||||
item = $(item);
|
||||
const author = item.find('.chat_info_author').text();
|
||||
|
||||
return {
|
||||
title: item.find('.chat_info_title').text(),
|
||||
description:
|
||||
`作者: ${author}<br><br>` +
|
||||
item
|
||||
.find('.chat_info_desc')
|
||||
.text()
|
||||
.replace(/\n/g, '<br>'),
|
||||
link: `https://gitbook.cn${item
|
||||
.find('a')
|
||||
.eq(0)
|
||||
.attr('href')}`,
|
||||
author,
|
||||
};
|
||||
})
|
||||
.get();
|
||||
|
||||
ctx.state.data = {
|
||||
title: 'GitChat-最新',
|
||||
link: 'https://gitbook.cn/gitchat/news',
|
||||
description: 'GitChat 是一款基于微信平台的知识分享产品。通过这款产品我们希望改变IT知识的学习方式。',
|
||||
item: resultItem,
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user