diff --git a/routes/zhihu/activities.js b/routes/zhihu/activities.js index 055c13e49..e1f9e0867 100644 --- a/routes/zhihu/activities.js +++ b/routes/zhihu/activities.js @@ -47,7 +47,16 @@ module.exports = async (ctx) => { break; case 'pin': title = detail.excerptTitle.length > 17 ? detail.excerptTitle.slice(0, 17) + '...' : detail.excerptTitle; - description = detail.excerptTitle; + const images = []; + let text = ""; + detail.content.forEach(contentItem => { + if (contentItem.type === "text") { + text = contentItem.ownText; + } else if (contentItem.type === "image") { + images.push(`

`); + } + }) + description = `

${text}

${images.join('')}`; url = `https://www.zhihu.com/pin/${detail.id}`; break; case 'question': @@ -55,6 +64,11 @@ module.exports = async (ctx) => { description = detail.excerpt; url = `https://www.zhihu.com/question/${detail.id}`; break; + case 'column': + title = detail.title; + description = `

${detail.intro}

`; + url = `${detail.url}`; + break; } return { @@ -65,4 +79,4 @@ module.exports = async (ctx) => { }; }), }); -}; \ No newline at end of file +};