mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-10-28 03:28:35 +08:00
feat: queshu title add book name (#2862)
This commit is contained in:
@@ -823,16 +823,6 @@ 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,可在链接中获取']"/>
|
||||
|
||||
## 人人都是产品经理
|
||||
|
||||
### 热门文章
|
||||
|
||||
@@ -48,6 +48,16 @@ pageClass: routes
|
||||
|
||||
<Route author="sanmmm" example="/liwushuo/index" path="/liwushuo/index"/>
|
||||
|
||||
## 缺书网
|
||||
|
||||
### 促销
|
||||
|
||||
<Route author="kt286" example="/queshu/sale" path="/queshu/sale"/>
|
||||
|
||||
### 单品活动信息
|
||||
|
||||
<Route author="kt286" example="/queshu/book/34626813" path="/queshu/book/:bookid" :paramsDesc="['图书ID,可在链接中获取']"/>
|
||||
|
||||
## 什么值得买
|
||||
|
||||
::: tip 提示
|
||||
|
||||
@@ -10,7 +10,7 @@ module.exports = async (ctx) => {
|
||||
title: `%title%`,
|
||||
allowEmpty: true,
|
||||
params: {
|
||||
title: '单品活动信息 - 缺书网',
|
||||
title: `$('#book_left > #h1').text().trim() + ' - 单品活动信息 - 缺书网'`,
|
||||
host,
|
||||
},
|
||||
item: {
|
||||
|
||||
@@ -22,6 +22,7 @@ module.exports = async (ctx) => {
|
||||
+ '发布时间:' + $('.news_sale_detail .sale_time_end.inline_right').text()
|
||||
|
||||
`,
|
||||
pubDate: `date($('.news_sale_detail .sale_time_end.inline_right').text())`,
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
@@ -2,6 +2,8 @@ const cheerio = require('cheerio');
|
||||
const got = require('@/utils/got');
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { addNoReferrer } = require('@/utils/common-utils');
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const date = require('@/utils/date');
|
||||
|
||||
function transElemText($, prop) {
|
||||
const regex = new RegExp(/\$\((.*)\)/g);
|
||||
@@ -43,6 +45,7 @@ async function buildData(data) {
|
||||
const $item = $(data.item.item);
|
||||
// 这里应该是可以通过参数注入一些代码的,不过应该无伤大雅
|
||||
return {
|
||||
link: data.link,
|
||||
title: getProp(data, 'title', $),
|
||||
description: getProp(data, 'description', $),
|
||||
allowEmpty: data.allowEmpty || false,
|
||||
|
||||
Reference in New Issue
Block a user