From 33d5e8df0acea754c078bda3190042dca0316ac9 Mon Sep 17 00:00:00 2001 From: Wang Junyu Date: Wed, 22 May 2019 10:51:47 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0Twitter=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E6=97=B6=E9=97=B4=E7=BA=BF=E7=9A=84image=20(#2190)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: 微博的description和image * 增加推特用户头像 --- lib/routes/twitter/user.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/routes/twitter/user.js b/lib/routes/twitter/user.js index 2090da53a..01ab5be57 100644 --- a/lib/routes/twitter/user.js +++ b/lib/routes/twitter/user.js @@ -11,11 +11,14 @@ module.exports = async (ctx) => { tweet_mode: 'extended', }); const data = result.data; + const userInfo = data[0].user; + const profileImageUrl = userInfo.profile_image_url || userInfo.profile_image_url_https; ctx.state.data = { - title: `${data[0].user.name} 的 Twitter`, + title: `${userInfo.name} 的 Twitter`, link: `https://twitter.com/${id}/`, - description: data[0].user.description, + image: profileImageUrl, + description: userInfo.description, item: utils.ProcessFeed({ data, }),