Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Seems I found an answer, for get more detailed and formatted info need to add additional parameter to contactsFeedUri for google.gdata.contacts.ContactQuery.</p> <p>This additional parameter is: ?v=3.0 So in my case function will looks like:</p> <pre><code>function getMyContacts() { var contactsFeedUri = 'https://www.google.com/m8/feeds/contacts/default/full?v=3.0&amp;alt=json'; var query = new google.gdata.contacts.ContactQuery(contactsFeedUri); setupContactsService(); contactsService.getContactFeed(query, handleContactsFeed, handleError); } </code></pre> <p>And for get necessary data I create a simple obj, which can be useful for somebody:</p> <pre><code>function contactEntry(entry) { this.entry = entry; this.testEntry = function() { alert( 'test entry' ) }; this.getFirstName = function() { if ((entry.gd$name == null) || (entry.gd$name.gd$givenName == null) || (entry.gd$name.gd$givenName.$t == null)) { return ''; } else { return entry.gd$name.gd$givenName.$t; } }; this.getLastName = function() { if ((entry.gd$name == null) || (entry.gd$name.gd$familyName == null) || (entry.gd$name.gd$familyName.$t == null)) { return ''; } else { return entry.gd$name.gd$familyName.$t; } }; this.getAdditionalName = function() { if ((entry.gd$name == null) || (entry.gd$name.gd$AdditionalName == null) || (entry.gd$name.gd$AdditionalName.$t == null)) { return ''; } else { return entry.gd$name.gd$familyName.$t; } }; this.getEmail = function() { if ((entry.gd$email == null) || (entry.gd$email.length == 0) || (entry.gd$email[0].address == null)) { return ''; } else { return entry.gd$email[0].address; } }; this.getStreet = function() { if (!this._addrExists() || (entry.gd$structuredPostalAddress[0].gd$street == null)) { return ''; } else { return entry.gd$structuredPostalAddress[0].gd$street.$t; } }; this.getCity = function() { if (!this._addrExists() || (entry.gd$structuredPostalAddress[0].gd$city == null)) { return ''; } else { return entry.gd$structuredPostalAddress[0].gd$city.$t; } }; this.getCountry = function() { if (!this._addrExists() || (entry.gd$structuredPostalAddress[0].gd$country == null)) { return ''; } else { return entry.gd$structuredPostalAddress[0].gd$country.$t; } }; this.getPostcode = function() { if (!this._addrExists() || (entry.gd$structuredPostalAddress[0].gd$postcode == null)) { return ''; } else { return entry.gd$structuredPostalAddress[0].gd$postcode.$t; } }; this.getPhone = function() { if ((entry.gd$phoneNumber == null) || (entry.gd$phoneNumber.length == 0) || (entry.gd$phoneNumber[0].$t == null)) { return ''; } else { return entry.gd$phoneNumber[0].$t } }; this.getOrganization = function() { if ((entry.gd$organization == null) || (entry.gd$organization.length == 0) || (entry.gd$organization[0].getOrgName() == null)) { return ''; } else { return entry.gd$organization[0].getOrgName().getValue(); } }; this.getBirthday = function() { if ((entry.gContact$birthday == null) || (entry.gContact$birthday.when == null)) { return ''; } else { return entry.gContact$birthday.when; } }; this.getEvent = function() { if ((entry.gContact$event == null) || (entry.gContact$event.length == 0) || (entry.gContact$event[0].gd$when == null)) { return ''; } else { return entry.gContact$event[0].gd$when.startTime; } }; // protected methods this._addrExists = function() { if ((entry.gd$structuredPostalAddress == null) || (entry.gd$structuredPostalAddress.length == 0)) { return false; } return true; }; } </code></pre> <p>It can be used in this way:</p> <pre><code>var handleContactsFeed = function(result) { var entries = result.feed.entry; var contact = new contactEntry(entries[0]); var address = {}; address['fname'] = contact.getFirstName(); address['lname'] = contact.getLastName() + (contact.getAdditionalName() != '' ? ' ' + contact.getAdditionalName() : ''); address['address'] = contact.getStreet(); address['city'] = contact.getCity(); address['country'] = contact.getCountry(); address['zip'] = contact.getPostcode(); address['phone'] = contact.getPhone(); address['mail'] = contact.getEmail(); address['organization'] = contact.getOrganization(); address['birthday'] = contact.getBirthday(); address['event'] = contact.getEvent(); } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload