i'm doing project using meteor. people can log in twitter. wondering if there way someones profile picture twitter in accounts.oncreateuser. here's have in mine :
accounts.oncreateuser(function(options, user) { var twitterinfo = user.services.twitter; if (options.profile){ options.profile.createdat = new date();//now! options.profile.twitterid = twitterinfo.id; options.profile.username = twitterinfo.screenname; options.profile.name = options.profile.name; user.profile = options.profile; } return user; });
thanks!
as per api (https://dev.twitter.com/docs/api/1/get/users/profile_image/%3ascreen_name) add in:
options.profile.display_picture="http://api.twitter.com/1/users/profile_image/"+twitterinfo.screenname;
this traditional way, in api 1.1 harder (https://dev.twitter.com/docs/user-profile-images-and-banners):
you need get users/show
, parse user
object profile_image_url
Comments
Post a Comment