我在做一個使用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