Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to import data of gmail contacts, using javascript Google Contact API, in more detailed format?
    primarykey
    data
    text
    <p>I'm using code from this page <a href="http://code.google.com/apis/contacts/docs/1.0/developers_guide_js.html" rel="nofollow">http://code.google.com/apis/contacts/docs/1.0/developers_guide_js.html</a> to get list of gmail contacts. Actually it works ok, but I get data of name, address, etc like a simple string, with "\n" as separator, for example:</p> <pre><code>&lt;script type="text/javascript"&gt; var contactsService; var scope = 'https://www.google.com/m8/feeds'; function setupContactsService() { //contactsService = new google.gdata.contacts.ContactsService('exampleCo-exampleApp-1.0'); contactsService = new google.gdata.contacts.ContactsService('GoogleInc-jsguide-1.0'); } function getMyContacts() { var contactsFeedUri = 'https://www.google.com/m8/feeds/contacts/default/full'; //?max-results=9999&amp;alt=json&amp;v=3.0 var query = new google.gdata.contacts.ContactQuery(contactsFeedUri); setupContactsService(); contactsService.getContactFeed(query, handleContactsFeed, handleError); } var handleContactsFeed = function(result) { var entries = result.feed.entry; for (var i = 0; i &lt; entries.length; i++) { var entry = entries[i]; var addrs = entry.getPostalAddresses(); var name = entry.getTitle(); // logging console.log(addrs[0]); console.log(name); } } function handleError(e) { alert(e.cause ? e.cause.statusText : e.message); } &lt;/script&gt; </code></pre> <p>it gives me an object where name and address values are simple strings.</p> <p>Can I get somehow data in like associative array format, where address will contains separate values of street, zip, city, country; and name separate values of first name, last name etc.</p> <p>Like:</p> <pre><code>{ "type": "address", "value": { "street": "Starret 1234", "city": "City name", "stateOrProvince": "ca", "postalCode": "73000", "country": "USA" } }, { "type": "name", "value": { "firstName": "Allen", "lastName" : "Iverson", ..... } } </code></pre> <p>Thanks in advance!</p>
    singulars
    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. 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