mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-08 05:59:00 +08:00
@@ -823,6 +823,16 @@ type 为 all 时,category 参数不支持 cost 和 free
|
||||
|
||||
</Route>
|
||||
|
||||
## 缺书网
|
||||
|
||||
### 促销
|
||||
|
||||
<Route author="kt286" example="/queshu/sale" path="/queshu/sale"/>
|
||||
|
||||
### 单品活动信息
|
||||
|
||||
<Route author="kt286" example="/queshu/book/34626813" path="/queshu/book/:bookid" :paramsDesc="['图书ID,可在链接中获取']"/>
|
||||
|
||||
## 人人都是产品经理
|
||||
|
||||
### 热门文章
|
||||
|
||||
@@ -1654,4 +1654,8 @@ router.get('/wechat-open/pay/announce', require('./routes/wechat-open/pay/announ
|
||||
// 币世界快讯
|
||||
router.get('/bishijie/kuaixun', require('./routes/bishijie/kuaixun'));
|
||||
|
||||
// 缺书网
|
||||
router.get('/queshu/sale', require('./routes/queshu/sale'));
|
||||
router.get('/queshu/book/:bookid', require('./routes/queshu/book'));
|
||||
|
||||
module.exports = router;
|
||||
|
||||
22
lib/routes/queshu/book.js
Normal file
22
lib/routes/queshu/book.js
Normal file
@@ -0,0 +1,22 @@
|
||||
const buildData = require('@/utils/common-config');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const bookid = ctx.params.bookid;
|
||||
const link = `http://www.queshu.com/book/${bookid}`;
|
||||
const host = `http://www.queshu.com`;
|
||||
ctx.state.data = await buildData({
|
||||
link,
|
||||
url: link,
|
||||
title: `%title%`,
|
||||
allowEmpty: true,
|
||||
params: {
|
||||
title: '单品活动信息 - 缺书网',
|
||||
host,
|
||||
},
|
||||
item: {
|
||||
item: '.stacked.right_state a',
|
||||
title: `$('.right_item .bodycol_258').text()`,
|
||||
link: `'%host%' + $('.right_item').parent().attr('href')`,
|
||||
},
|
||||
});
|
||||
};
|
||||
27
lib/routes/queshu/sale.js
Normal file
27
lib/routes/queshu/sale.js
Normal file
@@ -0,0 +1,27 @@
|
||||
const buildData = require('@/utils/common-config');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const link = `http://www.queshu.com/sale/`;
|
||||
const host = `http://www.queshu.com`;
|
||||
ctx.state.data = await buildData({
|
||||
link,
|
||||
url: link,
|
||||
title: `%title%`,
|
||||
params: {
|
||||
title: '图书促销 - 缺书网',
|
||||
host,
|
||||
},
|
||||
item: {
|
||||
item: '#tb_sale tr',
|
||||
title: `$('.news_sale_detail .sale_btn').text() + ':' + $('.news_sale_title a').text()`,
|
||||
link: `'%host%' + $('.news_sale_title a').attr('href')`,
|
||||
description: `$('.news_sale_detail .sale_btn').text() + ':' + $('.news_sale_title a').text()
|
||||
+ '<br>'
|
||||
+ $('.news_sale_detail .sale_time_end').first().text()
|
||||
+ '<br>'
|
||||
+ '发布时间:' + $('.news_sale_detail .sale_time_end.inline_right').text()
|
||||
|
||||
`,
|
||||
},
|
||||
});
|
||||
};
|
||||
@@ -45,6 +45,7 @@ async function buildData(data) {
|
||||
return {
|
||||
title: getProp(data, 'title', $),
|
||||
description: getProp(data, 'description', $),
|
||||
allowEmpty: data.allowEmpty || false,
|
||||
item: $item
|
||||
.map((_, e) => {
|
||||
const $elem = (selector) => $(e).find(selector);
|
||||
|
||||
Reference in New Issue
Block a user