diff --git a/lib/routes/juejin/pins.js b/lib/routes/juejin/pins.js
index 8d96de0fd6..108b429af6 100644
--- a/lib/routes/juejin/pins.js
+++ b/lib/routes/juejin/pins.js
@@ -3,53 +3,42 @@ const got = require('@/utils/got');
module.exports = async (ctx) => {
const response = await got({
method: 'post',
- url: 'https://web-api.juejin.im/graphql',
- json: { operationName: '', query: '', variables: { size: 20, after: '', afterPosition: '' }, extensions: { query: { id: '964dab26a3f9997283d173b865509890' } } },
- headers: {
- 'X-Agent': 'Juejin/Web',
- },
+ url: 'https://apinew.juejin.im/recommend_api/v1/short_msg/recommend',
+ json: true,
+ data: { id_type: 4, sort_type: 300, cursor: '0', limit: 20 },
});
- const items = response.data.data.recommendedActivityFeed.items.edges.map(
- ({
- node: {
- targets: [item],
- },
- }) => {
- const content = item.content;
- const title = content;
- const guid = item.id;
- const link = `https://juejin.im/pin/${guid}`;
- const pubDate = new Date(item.createdAt).toUTCString();
- const author = item.user.username;
- const imgs = item.pictures.reduce((imgs, item) => {
- imgs += `
+ const items = response.data.data.map((item) => {
+ const content = item.msg_Info.content;
+ const title = content;
+ const guid = item.msg_id;
+ const link = `https://juejin.im/pin/${guid}`;
+ const pubDate = new Date(parseInt(item.msg_Info.ctime) * 1000).toUTCString();
+ const author = item.author_user_info.user_name;
+ const imgs = item.msg_Info.pic_list.reduce((imgs, item) => {
+ imgs += `

`;
- return imgs;
- }, '');
- const url = item.url;
- const urlTitle = item.urlTitle;
- const description = `
+ return imgs;
+ }, '');
+ const description = `
${content.replace(/\n/g, '
')}
${imgs}
- ${urlTitle}
`;
- return {
- title,
- link,
- description,
- guid,
- pubDate,
- author,
- };
- }
- );
+ return {
+ title,
+ link,
+ description,
+ guid,
+ pubDate,
+ author,
+ };
+ });
ctx.state.data = {
- title: '沸点 - 动态',
- link: 'https://juejin.im/activities/recommended',
+ title: '沸点 - 推荐',
+ link: 'https://juejin.im/pins/recommended',
item: items,
};
};