mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-15 18:30:53 +08:00
@@ -586,6 +586,12 @@ RSSHub 提供下列 API 接口:
|
||||
|
||||
</route>
|
||||
|
||||
<route name="小册" author="xyqfer" example="/juejin/books" path="/juejin/books"/>
|
||||
|
||||
> 掘金小册需要付费订阅, RSS 仅做更新提醒, 不含付费内容.
|
||||
|
||||
<route name="沸点" author="xyqfer" example="/juejin/pins" path="/juejin/pins"/>
|
||||
|
||||
### Dockone
|
||||
|
||||
<route name="周报" author="csi0n" example="/dockone/weekly" path="/dockone/weekly"/>
|
||||
|
||||
@@ -143,6 +143,8 @@ router.get('/ncm/djradio/:id', require('./routes/ncm/djradio'));
|
||||
router.get('/juejin/category/:category', require('./routes/juejin/category'));
|
||||
router.get('/juejin/tag/:tag', require('./routes/juejin/tag'));
|
||||
router.get('/juejin/trending/:category/:type', require('./routes/juejin/trending'));
|
||||
router.get('/juejin/books', require('./routes/juejin/books'));
|
||||
router.get('/juejin/pins', require('./routes/juejin/pins'));
|
||||
|
||||
// 自如
|
||||
router.get('/ziroom/room/:city/:iswhole/:room/:keyword', require('./routes/ziroom/room'));
|
||||
|
||||
27
routes/juejin/books.js
Normal file
27
routes/juejin/books.js
Normal file
@@ -0,0 +1,27 @@
|
||||
const axios = require('../../utils/axios');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const response = await axios({
|
||||
method: 'get',
|
||||
url: 'https://xiaoce-timeline-api-ms.juejin.im/v1/getListByLastTime?uid=&client_id=&token=&src=web&alias=&pageNum=1',
|
||||
});
|
||||
|
||||
const data = response.data.d;
|
||||
|
||||
ctx.state.data = {
|
||||
title: '掘金小册',
|
||||
link: 'https://juejin.im/books',
|
||||
item: data.map(({ title, id, img, desc, createdAt, price }) => ({
|
||||
title,
|
||||
link: `https://juejin.im/book/${id}`,
|
||||
description: `
|
||||
<img referrerpolicy="no-referrer" src="${img}"><br>
|
||||
<strong>${title}</strong><br><br>
|
||||
${desc}<br>
|
||||
<strong>价格:</strong> ${price}元
|
||||
`,
|
||||
pubDate: new Date(createdAt).toUTCString(),
|
||||
guid: id,
|
||||
})),
|
||||
};
|
||||
};
|
||||
36
routes/juejin/pins.js
Normal file
36
routes/juejin/pins.js
Normal file
@@ -0,0 +1,36 @@
|
||||
const axios = require('../../utils/axios');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const response = await axios({
|
||||
method: 'get',
|
||||
url: 'https://short-msg-ms.juejin.im/v1/pinList/recommend?uid=&device_id=&token=&src=web&before&limit=50',
|
||||
});
|
||||
|
||||
const data = response.data.d.list;
|
||||
|
||||
ctx.state.data = {
|
||||
title: '沸点 - 掘金',
|
||||
link: 'https://juejin.im/pins',
|
||||
item: data.map(({ content, objectId, createdAt, user, pictures, url, urlTitle }) => {
|
||||
const imgs = pictures.reduce((imgs, item) => {
|
||||
imgs += `
|
||||
<img referrerpolicy="no-referrer" src="${item}"><br>
|
||||
`;
|
||||
return imgs;
|
||||
}, '');
|
||||
|
||||
return {
|
||||
title: content,
|
||||
link: `https://juejin.im/pin/${objectId}`,
|
||||
description: `
|
||||
${content}<br>
|
||||
${imgs}<br>
|
||||
<a href="${url}">${urlTitle}</a><br>
|
||||
`,
|
||||
pubDate: new Date(createdAt).toUTCString(),
|
||||
author: user.username,
|
||||
guid: objectId,
|
||||
};
|
||||
}),
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user