如何使 Twitter 的头像更大(NodeJs、Ejs 和护照)

GY2*_*Y22 1 twitter size node.js passport.js

一些背景信息:我正在使用 node.js、express 框架、mongo 和passport-twitter

我能够成功登录 Twitter 并将信息(如 id、用户名、个人资料图片)存储到 db (mongo)。我可以使用 ejs 将它传递给我的视图,但它显示的图像很小。

我在 Twitter 开发者页面上读到,您可以传递图片的替代尺寸

我的问题是如何使用passport.js 语法来做到这一点,这是我将图像保存到我的数据库的代码:

 newUser.twitter.profilePic  = profile.photos[0].value;
Run Code Online (Sandbox Code Playgroud)

输出如下:http : //pbs.twimg.com/profile_images/568828382079483905/FuEj1pBH_normal.png

我试过这段代码:

newUser.twitter.profilePic  = profile._json.profile_image_url.replace('_original','');
Run Code Online (Sandbox Code Playgroud)

但它仍然将图像保存到我的数据库中,如下所示 -> http://pbs.twimg.com/profile_images/568828382079483905/FuEj1pBH_normal.png

所以基本上我要问的是如何使推特图片更大。如何使用护照语法传递正确的尺寸

在此先感谢您的帮助

Din*_*aws 5

只需像以下网址一样删除_normal:-

http://pbs.twimg.com/profile_images/568828382079483905/FuEj1pBH.png

谢谢