samedi 4 avril 2015

How to make the profile picture of Twitter bigger (NodeJs, Ejs and passport)

Some background info: I am working with node.js, express framework, mongo and passport-twitter


I am able to successfully login in with Twitter and store info like id, username, profile pic to db (mongo). I am able to pass it along to my view with ejs but it shows the image pretty small.


I read on the Twitter developer page that you can pass along alternate sizes for the picture


My question is how to do this with the passport.js syntax, this is the code that i have for saving the image to my db:



newUser.twitter.profilePic = profile.photos[0].value;


the output is the following: http://ift.tt/1NOzOjR


i tried this bit of code:



newUser.twitter.profilePic = profile._json.profile_image_url.replace('_original','');


but it still saves the image to my db as follow -> http://ift.tt/1NOzOjR


So basically what i am asking is how to make the twitter picture bigger. How to pass on the right size with passport syntax


Thanks in advance for any help


Aucun commentaire:

Enregistrer un commentaire