feat(route): add wanqu (#12166)
* feat(route): add wanqu * Update docs/new-media.md * Update lib/v2/wanqu/maintainer.js ---------
This commit is contained in:
parent
a2814f47ca
commit
dd82c1da0e
|
|
@ -3812,6 +3812,12 @@ column 为 third 时可选的 category:
|
|||
|
||||
<Route author="shuiRong" example="/wainao-reads/all-articles" path="/wainao-reads/all-articles" />
|
||||
|
||||
## 湾区日报
|
||||
|
||||
### 最新推荐
|
||||
|
||||
<Route author="Fatpandac" example="/wanqu/news" path="/wanqu/news" radar="1" />
|
||||
|
||||
## 晚点 LatePost
|
||||
|
||||
### 报道
|
||||
|
|
|
|||
|
|
@ -0,0 +1,3 @@
|
|||
module.exports = {
|
||||
'/news': ['Fatpandac'],
|
||||
};
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
const got = require('@/utils/got');
|
||||
const cheerio = require('cheerio');
|
||||
const { parseDate } = require('@/utils/parse-date');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const rootUrl = 'https://www.wanqu.co';
|
||||
const currentUrl = rootUrl;
|
||||
|
||||
const response = await got(currentUrl);
|
||||
|
||||
const $ = cheerio.load(response.data);
|
||||
|
||||
const items = $('div.mb-4')
|
||||
.toArray()
|
||||
.map((item) => ({
|
||||
title: $(item).text(),
|
||||
link: $(item).find('a').attr('href'),
|
||||
pubDate: parseDate($(item).find('i.text-helper-color.mr-4').text()),
|
||||
}));
|
||||
|
||||
ctx.state.data = {
|
||||
title: '湾区日报 - 最新推荐',
|
||||
link: currentUrl,
|
||||
item: items,
|
||||
};
|
||||
};
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
module.exports = {
|
||||
'wanqu.co': {
|
||||
_name: '湾区日报',
|
||||
'.': [
|
||||
{
|
||||
title: '最新推荐',
|
||||
docs: 'https://docs.rsshub.app/new-media.html#wan-qu-ri-bao',
|
||||
source: ['/'],
|
||||
target: '/wanqu/news',
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
module.exports = function (router) {
|
||||
router.get('/news', require('./news'));
|
||||
};
|
||||
Loading…
Reference in New Issue