Enhancement: 知乎 (#1134)
- 增加知乎书店、知乎想法-24小时新闻汇总
- 顺便修复了 commit log 过长的 bug 🌚
This commit is contained in:
parent
13e942b247
commit
2b26dcced5
|
|
@ -423,6 +423,10 @@ RSSHub 提供下列 API 接口:
|
|||
|
||||
<route name="用户想法" author="xyqfer" example="/zhihu/people/pins/kan-dan-45" path="/zhihu/people/pins/:id" :paramsDesc="['作者 id, 可在用户主页 URL 中找到']"/>
|
||||
|
||||
<route name="知乎书店-新书" author="xyqfer" example="/zhihu/bookstore/newest" path="/zhihu/bookstore/newest"/>
|
||||
|
||||
<route name="知乎想法-24小时新闻汇总" author="xyqfer" example="/zhihu/pin/daily" path="/zhihu/pin/daily"/>
|
||||
|
||||
### pixiv
|
||||
|
||||
<route name="用户收藏" author="EYHN" example="/pixiv/user/bookmarks/15288095" path="/pixiv/user/bookmarks/:id" :paramsDesc="['用户 id, 可在用户主页 URL 中找到']"/>
|
||||
|
|
|
|||
|
|
@ -169,6 +169,8 @@ router.get('/zhihu/pin/hotlist', require('./routes/zhihu/pin/hotlist'));
|
|||
router.get('/zhihu/question/:questionId', require('./routes/zhihu/question'));
|
||||
router.get('/zhihu/topic/:topicId', require('./routes/zhihu/topic'));
|
||||
router.get('/zhihu/people/pins/:id', require('./routes/zhihu/pin/people'));
|
||||
router.get('/zhihu/bookstore/newest', require('./routes/zhihu/bookstore/newest'));
|
||||
router.get('/zhihu/pin/daily', require('./routes/zhihu/pin/daily'));
|
||||
|
||||
// 妹子图
|
||||
router.get('/mzitu/home/:type?', require('./routes/mzitu/home'));
|
||||
|
|
|
|||
|
|
@ -0,0 +1,30 @@
|
|||
const axios = require('../../../utils/axios');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const response = await axios({
|
||||
method: 'get',
|
||||
url: 'https://api.zhihu.com/books/features/new',
|
||||
});
|
||||
|
||||
const data = response.data.data;
|
||||
|
||||
ctx.state.data = {
|
||||
title: '知乎书店-新书抢鲜',
|
||||
link: 'https://www.zhihu.com/pub/features/new',
|
||||
item: data.map((item) => {
|
||||
const authors = item.authors.map((author) => author.name).join('、');
|
||||
|
||||
return {
|
||||
title: item.title,
|
||||
link: item.url,
|
||||
description: `
|
||||
<img referrerpolicy="no-referrer" src="${item.cover.replace(/_.+\.jpg/g, '.jpg')}"><br>
|
||||
<strong>${item.title}</strong><br>
|
||||
作者: ${authors}<br><br>
|
||||
${item.description}<br><br>
|
||||
价格: ${item.promotion.price / 100}元
|
||||
`,
|
||||
};
|
||||
}),
|
||||
};
|
||||
};
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
const axios = require('../../../utils/axios');
|
||||
const { generateData } = require('./utils');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const {
|
||||
data: { data },
|
||||
} = await axios({
|
||||
method: 'get',
|
||||
url: 'https://api.zhihu.com/pins/special/972884951192113152/moments?order_by=newest&reverse_order=0&limit=20',
|
||||
});
|
||||
|
||||
ctx.state.data = {
|
||||
title: '知乎想法-24小时新闻汇总',
|
||||
link: 'https://www.zhihu.com/pin/special/972884951192113152',
|
||||
description: '汇集每天的社会大事、行业资讯,让你用最简单的方式获得想法里的新闻',
|
||||
item: generateData(data),
|
||||
};
|
||||
};
|
||||
Loading…
Reference in New Issue