mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-09-24 23:12:34 +08:00
@@ -172,6 +172,12 @@ pageClass: routes
|
||||
|
||||
</Route>
|
||||
|
||||
## 搜韵网
|
||||
|
||||
### 诗词日历
|
||||
|
||||
<Route author="nczitzk" example="/souyun/today" path="/souyun/today"/>
|
||||
|
||||
## 网易公开课
|
||||
|
||||
### 精品课程
|
||||
|
||||
@@ -3061,6 +3061,9 @@ router.get('/telecompaper/news/:caty/:year?/:country?/:type?/:keyword?', require
|
||||
// 水木社区
|
||||
router.get('/newsmth/account/:id', require('./routes/newsmth/account'));
|
||||
|
||||
// 搜韵网
|
||||
router.get('/souyun/today', require('./routes/souyun/today'));
|
||||
|
||||
// 生物谷
|
||||
router.get('/bioon/latest', require('./routes/bioon/latest'));
|
||||
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
const got = require('@/utils/got');
|
||||
const cheerio = require('cheerio');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const currentUrl = 'https://sou-yun.cn/AncientToday.aspx';
|
||||
const poemUrl = 'https://api.sou-yun.cn/api/RecommendedReading?type=poem&needHtml=true';
|
||||
const wordUrl = 'https://api.sou-yun.cn/api/RecommendedReading?type=word';
|
||||
|
||||
const response = await got({
|
||||
method: 'get',
|
||||
url: currentUrl,
|
||||
});
|
||||
|
||||
const poemResponse = await got({
|
||||
method: 'get',
|
||||
url: poemUrl,
|
||||
});
|
||||
|
||||
const wordResponse = await got({
|
||||
method: 'get',
|
||||
url: wordUrl,
|
||||
});
|
||||
|
||||
const $ = cheerio.load(response.data);
|
||||
const birthday = $('span.titleHint').parent().html();
|
||||
const today = $('input[name="LastSelectedDate"]').attr('value');
|
||||
|
||||
ctx.state.data = {
|
||||
title: '搜韵网 - 诗词日历',
|
||||
link: currentUrl,
|
||||
item: [
|
||||
{
|
||||
title: poemResponse.data.Date,
|
||||
link: currentUrl,
|
||||
description: poemResponse.data.Content.Text + '<br>' + birthday + '<br>' + wordResponse.data.Content.Text,
|
||||
pubDate: new Date(today + ' GMT+8').toUTCString(),
|
||||
},
|
||||
],
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user