我在做一个使用Meteor的项目。人们可以使用Twitter登录。我想知道是否有一种方法可以在Accounts.onCreateUser中从Twitter获取某人的个人资料图片。这里是我在我的:你如何得到某人在流星上的Twitter个人资料照片?
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;
});
谢谢!在
感谢兄弟,这工作。 – moni 2013-05-12 21:49:32
api 1.0已弃用且不再可用。 – pahan 2013-09-23 05:55:18
我还提到过如何使用1.1,你需要从用户对象中获取'/ users/show'并从'profile_image_url'中取出。您需要首先使用OAuth并使用该令牌发出请求 – Akshat 2013-09-23 06:59:05