diff --git a/lib/utils/render.js b/lib/utils/render.js
index 978eca4d4..35d7159da 100644
--- a/lib/utils/render.js
+++ b/lib/utils/render.js
@@ -41,6 +41,7 @@ const json = (data) => {
},
]
: undefined,
+ _extra: item._extra || undefined,
})),
};
return JSON.stringify(jsonFeed, null, 4);
diff --git a/lib/v2/jike/user.js b/lib/v2/jike/user.js
index 85612e772..9f226f3ff 100644
--- a/lib/v2/jike/user.js
+++ b/lib/v2/jike/user.js
@@ -18,6 +18,17 @@ module.exports = async (ctx) => {
const raw = $('[type = "application/json"]').html();
const data = JSON.parse(raw).props.pageProps;
+ const getLink = (id, type) => {
+ switch (type) {
+ case 'REPOST':
+ return `https://m.okjike.com/reposts/${id}`;
+ case 'MEDIUM':
+ return `https://www.okjike.com/medium/${id}`;
+ default:
+ return `https://m.okjike.com/originalPosts/${id}`;
+ }
+ };
+
const items = await Promise.all(
data.posts.map(async (item) => {
const typeMap = {
@@ -28,16 +39,6 @@ module.exports = async (ctx) => {
PERSONAL_UPDATE: '创建新主题',
};
- const linkMap = {
- ORIGINAL_POST: `https://m.okjike.com/originalPosts/${item.id}`,
- REPOST: `https://m.okjike.com/reposts/${item.id}`,
- MEDIUM: `https://www.okjike.com/medium/${item.id}`,
- // OFFICIAL_MESSAGE: `https://m.okjike.com/originalPosts/${item.id}`,
- // ANSWER: `https://m.okjike.com/answer/${item.id}`,
- // QUESTION: `https://m.okjike.com/originalPosts/${item.id}`,
- // PERSONAL_UPDATE: `https://m.okjike.com/topic/${item.id}${item.topic && item.topic.id}`,
- };
-
let linkTemplate = '';
if (item.linkInfo && item.linkInfo.linkUrl) {
linkTemplate = `${item.linkInfo.title}
`;
@@ -58,6 +59,7 @@ module.exports = async (ctx) => {
content = `${content}
`;
}
+ let repostContent;
if (item.type === 'REPOST') {
const screenNameTemplate = item.target.user ? `@${item.target.user.screenName}` : '';
@@ -67,7 +69,7 @@ module.exports = async (ctx) => {
repostImgTemplate += ``;
});
- const repostContent = `转发 ${screenNameTemplate}: ${item.target.content}${repostImgTemplate}`.replace(/\r\n|\n|\r/g, '
');
+ repostContent = `
`; @@ -260,6 +261,7 @@ const ProcessFeed = (ctx, { data = [] }, params = {}) => { if (readable) { quote += ``; } + quote += '