feat(route): add 奇葩买家秀 (#9846)
* feat(route): add 奇葩买家秀 * Update lib/v2/qipamaijia/index.js
This commit is contained in:
@@ -592,6 +592,12 @@ R18 显示
|
||||
|
||||
<Route author="xyqfer" example="/dapenti/subject/184" path="/dapenti/subject/:id" :paramsDesc="['主题 id']"/>
|
||||
|
||||
## 奇葩买家秀
|
||||
|
||||
### 频道
|
||||
|
||||
<Route author="Fatpandac" example="/qipamaijia/fuli" path="/qipamaijia/:cate?" :paramsDesc="['频道名,可在对应网址中找到,默认为最新']" radar="1" rssbud="1"/>
|
||||
|
||||
## 涂鸦王国
|
||||
|
||||
### 用户上传作品和用户喜欢作品
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
const got = require('@/utils/got');
|
||||
const cheerio = require('cheerio');
|
||||
|
||||
const rootUrl = 'https://www.qipamaijia.com';
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const cate = ctx.params.cate ?? '';
|
||||
const url = `${rootUrl}/${cate}`;
|
||||
|
||||
const response = await got(url);
|
||||
const $ = cheerio.load(response.data);
|
||||
const title = $('#highlight').text();
|
||||
const items = $('div.col_l > div.block')
|
||||
.map((_index, item) => ({
|
||||
title: $(item).find('div.content').text(),
|
||||
link: $(item).find('a').attr('href'),
|
||||
description: $(item).find('div.content').html() + $(item).find('div.thumb').html(),
|
||||
}))
|
||||
.get();
|
||||
|
||||
ctx.state.data = {
|
||||
title: `奇葩买家秀 - ${title}`,
|
||||
link: url,
|
||||
item: items,
|
||||
};
|
||||
};
|
||||
@@ -0,0 +1,3 @@
|
||||
module.exports = {
|
||||
'/:cate?': ['Fatpandac'],
|
||||
};
|
||||
@@ -0,0 +1,13 @@
|
||||
module.exports = {
|
||||
'qipamaijia.com': {
|
||||
_name: '奇葩买家秀',
|
||||
'.': [
|
||||
{
|
||||
title: '频道',
|
||||
docs: 'https://docs.rsshub.app/reading.html#qi-dian-tu-shou-ding',
|
||||
source: ['/', '/:cate'],
|
||||
target: '/qipamaijia/:cate',
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,3 @@
|
||||
module.exports = function (router) {
|
||||
router.get('/:cate?', require('./index'));
|
||||
};
|
||||
Reference in New Issue
Block a user