This is my first post on this site, so forgive me if I destroy it, but I will try to be as clear and direct forward as possible.
I am trying to use the Google Contacts API to import a name and email address from an authenticated gmail account. I get the email address in order using the common code provided by Google itself. I tried changing it to get contact names, but to no avail. Any help would be greatly appreciated. Below is the code I'm currently using.
$xml = new SimpleXMLElement($val->getResponseBody()); $xml->registerXPathNamespace('gd', 'http://schemas.google.com/g/2005'); $result = $xml->xpath('//gd:email'); $name_result = $xml->xpath('//title'); foreach ($result as $title) { echo "<div>".$title->attributes()->address."</div>"; } foreach ($name_result as $name) { echo "<div class='contact_alt'>".$name."</div>"; }
source share