The one script I found that came close only adds the phone number and comments, nothing else:
$extension = new Zend_Gdata_App_Extension_Element('email', null, '
$attributes['address'] = array('namespaceUri'=>null,'name'=>'address',
'value' => $emailaddy);
$attributes['rel'] = array('namespaceUri'=>null,'name'=>'rel', 'value' => '
$attributes['primary'] = array('namespaceUri'=>null,'name'=>'primary',
'value' => 'true');
$extension->setExtensionAttributes($attributes);
$entry = $gdata->newEntry();
$entry->title = $gdata->newTitle($name);
$entry->setExtensionElements(array($extension));
$extensionElements = $entry->getExtensionElements();
$extension2 = new Zend_Gdata_App_Extension_Element('postalAddress',
$attributes2 = array();
$extension2->setText($contactAddress);
$attributes2['rel'] = array('namespaceUri'=>null,'name'=>'rel', 'value'
$attributes2['primary'] = array('namespaceUri'=>null,'name'=>'primary',
'value' => 'true');
$extension2->setExtensionAttributes($attributes2);
array_push($extensionElements, $extension2);
$entry->setExtensionElements($extensionElements);
$extensionElements = $entry->getExtensionElements();
$extension3 = new Zend_Gdata_App_Extension_Element('phoneNumber', null,
$attributes3 = array();
$extension3->setText($phone);
$attributes3['rel'] = array('namespaceUri'=>null,'name'=>'rel', 'value'
$attributes3['primary'] = array('namespaceUri'=>null,'name'=>'primary',
'value' => 'true');
$extension3->setExtensionAttributes($attributes3);
array_push($extensionElements, $extension3);
$entry->setExtensionElements($extensionElements);
$content = $gdata->newContent($comments);
$content->setType('text');
$entry->content = $content;
$entryResult = $gdata->insertEntry($entry,$mystream);
This script I found only seems to add the name, email, and company name, nothing else:
$doc = new DOMDocument();
$doc->formatOutput = true;
$entry = $doc->createElement('atom:entry');
$doc->appendChild($entry);
// add name element
$name = $doc->createElement('gd:name');
$entry->appendChild($name);
$name1="Jason Mac";
$fullName = $doc->createElement('gd:fullName', $name1);
$name->appendChild($fullName);
// add email element
$email = $doc->createElement('gd:email');
$email1=$emailAddress;
$email->setAttribute('address' ,$email1);
$entry->appendChild($email);
// add org name element
$org = $doc->createElement('gd:organization');
$entry->appendChild($org);
$orgNamer="my Org";
$orgName = $doc->createElement('gd:orgName', $orgNamer);
$org->appendChild($orgName);
// add org name element
$Phone = $doc->createElement('gd:Phone');
$entry->appendChild($Phone);
$phone1="7777777777";
$PhoneName = $doc->createElement('gd:PhoneName', $phone1);
$Phone->appendChild($PhoneName);
// insert entry
Any suggestions on how to add the name, address, phone, email, and organization name for a contact would be greatly appreciated! (and if you know how to add multiple email addresses / multiple phone numbers that's a big bonus)