我正在尝试从联系人提要http://www.google.com/m8/feeds/contacts/default/full的 google 联系人 api 获取联系人姓名、电子邮件和电话
var entries = result.feed.entry;
for (var i = 0; i < entries.length; i++) {
var contactEntry = entries[i];
var emailAddresses = contactEntry.getEmailAddresses();
for (var j = 0; j < emailAddresses.length; j++) {
var emailAddress = emailAddresses[j].getAddress();
vemail += emailAddress + ',';
}
var fname = contactEntry.getPhoneNumbers();
if (phoneNumbers.length == 0) {
console.log('phone number = N/A');
} else {
for (var j = 0; j < phoneNumbers.length; j++) {
var phoneNumber = phoneNumbers[j].getValue() || 'N/A';
console.log('phone number = ' + phoneNumber);
}
}
}
我可以从上面的代码中获取电话号码和电子邮件。我也可以知道如何获得名称吗?谢谢