Hi,

If you are not able to use Zend, you could work directly with Curl in
PHP using the protocol:
http://code.google.com/apis/contacts/docs/2.0/developers_guide_protocol.html

Unfortunately I don't have an easier out of the box example at hand,
but there are some examples in this thread:
http://groups.google.com/group/google-contacts-api/browse_thread/thread/f6dcf92775f8549/18baf98b53cb8269

Using the protocol directly may not be an easy task and I see that you
also tried the JavaScript client, you can find more information here:
http://code.google.com/apis/contacts/docs/1.0/developers_guide_js.html

--Julian


On May 16, 12:55 pm, sebastian de comocomo <[email protected]>
wrote:
> Hi,
>
> I tried this code, from the 
> developers_guidehttp://code.google.com/apis/contacts/docs/1.0/developers_guide_js.html
>
> It says we can see Public feeds without any authentication
>
> My supplier doesn't have ZEND
>
> It also says " Retrieving contacts using query parameters"
>
> I'd like to retrieve public profiles based on a query.
>
> Does anyone have a full example from a-z?
>
> Do I need to download any scripts? Ex. Like the picker.js ?
>
> I've tried many things, and I get a white page.
>
> Even the simplest example in the developers_guide doesn't work?
>
> What am I doing wrong, am a bit frustrated as you can see. Too many tests to
> find out my supplier didn't have ZEND. I didn't even know I needed that. I
> didn't have it in my local host neither. So imagine ;o)
>
> Thanks
> sebastian
>
> <html>
> <head>
>
> <script type="text/javascript"
>   src="http://www.google.com/jsapi";>
> </script>
>
> <script>
>
> google.load("gdata", "1.x");
>
> google.setOnLoadCallback(initFunc);
>
>   /*
>  * Retrieve all contacts
>  */
>
> // Create the contacts service object
> var contactsService =
>     new google.gdata.contacts.ContactsService('GoogleInc-jsguide-1.0');
>
> // The feed URI that is used for retrieving contacts
> var feedUri =
> 'http://www.google.com/m8/feeds/contacts/[email protected]/full';
>
> // I ALSO TRIED WITH DEFAULT
>
> var query = new google.gdata.contacts.ContactQuery(feedUri);
>
> // Set the maximum of the result set to be 50
> query.setMaxResults(50);
>
> // callback method to be invoked when getContactFeed() returns data
> var callback = function(result) {
>
>   // An array of contact entries
>   var entries = result.feed.entry;
>
>   // Iterate through the array of contact entries
>   for (var i = 0; i < entries.length; i++) {
>     var contactEntry = entries[i];
>
>     var emailAddresses = contactEntry.getEmailAddresses();
>
>     // Iterate through the array of emails belonging to a single contact
> entry
>     for (var j = 0; j < emailAddresses.length; j++) {
>       var emailAddress = emailAddresses[j].getAddress();
>       PRINT('email = ' + emailAddress);
>     }    
>   }
>
> }
>
> // Error handler
> var handleError = function(error) {
>   PRINT(error);
>
> }
>
> // Submit the request using the contacts service object
> contactsService.getContactFeed(query, callback, handleError);
> </script>
> </head>
> <body>
>
> On 15/05/09 17:46, "Julian (Google)" <[email protected]> wrote:
>
>
>
> > Hi Sebastian,
>
> > You can try this example:
>
> > <?php
>
> > $clientLibraryPath = '/var/www/contacts/Zend';
> > $oldPath = set_include_path(get_include_path() . PATH_SEPARATOR .
> > $clientLibraryPath);
>
> > require_once 'Loader.php';
>
> > Zend_Loader::loadClass('Zend_Gdata_ClientLogin');
> > Zend_Loader::loadClass('Zend_Gdata_Gapps');
> > Zend_Loader::loadClass('Zend_Gdata_Query');
>
> > // Using Client Login
> > $client = Zend_Gdata_ClientLogin::getHttpClient("[email protected]",
> > "PASSWORD", "cp");
> > $gdata = new Zend_Gdata($client);
> > $query = new Zend_Gdata_Query('http://www.google.com/m8/feeds/contacts/
> > user%40domain.com/full');
> > $query->setMaxResults(1000);
> > $feed = $gdata->getFeed($query);
>
> > $xml = new SimpleXMLElement($feed->getXML());
> > $entries = $xml->children('http://www.w3.org/2005/Atom');
>
> > foreach ($entries->entry as $entry ) {
> >   $defaults = $entry->children('http://schemas.google.com/g/2005');
> >   echo 'title: '. $entry->title;
> >   if ( isset($defaults->email)){
> >     echo  ' email: '. isset($defaults->email->attributes()->address);
> >   }
> >   echo ' address: '.$defaults->postalAddress;
> > }
> > ?>
>
> > --Julian
>
> > On May 14, 1:14 pm, Sebastian <[email protected]> wrote:
> >> Hi,
>
> >> sorry but I still don't understand how to make this work.
>
> >> I just want to get a list of my contacts, (picture, email, name,
> >> address, gender, phone number, lat & lng)
>
> >> I get this message:
>
> >> No input file specified.
>
> >> 1st.) I'm granted access
> >> 2nd.) it sends me to the page with the Token:
>
> >>http://allmybookings.com/viewcontacts.php?token=CK3iteHqChDTl6Hf______8B
>
> >> 3rd.) I get the message: "No input file specified.".
>
> >> In the config. I specified "viewcontacts.php". So, I don't understand.
>
> >> I tried all the example codes in this dicussion group "Contact API for
> >>PHP",
>
> >> I just put <? in the front and ?> at the end to make itPHP.
>
> >> I put my gmail email, and it's password.
>
> >> am I suppose to do something else?
>
> >> Could someone post a full code, in which I just need to change my
> >> email & password?
>
> >>  <?
>
> >> require_once 'Zend/Loader.php';
> >> Zend_Loader::loadClass('Zend_Gdata_ClientLogin');
> >> Zend_Loader::loadClass('Zend_Gdata_Gapps');
> >> Zend_Loader::loadClass('Zend_Gdata_Query');
>
> >> // Using Client Login
> >> $client = Zend_Gdata_ClientLogin::getHttpClient
> >> ("[email protected]","MYPASSWORD", "cp");
> >> $gdata = new Zend_Gdata($client);
> >> $query = new Zend_Gdata_Query('http://www.google.com/m8/feeds/
> >> contacts/
> >> default/full');
>
> >> $query->setMaxResults(100);
> >> $feed = $gdata->getFeed($query);
>
> >> foreach ($feed as $entry) {
> >>   $XMLContent = $entry->getXML();
> >>   print_r( $XMLContent );
>
> >> }
>
> >> ?>
>
> >> Thanks
> >> Sebastian
>
> >> On Mar 31, 12:11 pm, Ashvin Savani <[email protected]> wrote:
>
> >>> I don't remember the exact link but you can do google with curlphp
> >>> class and you should get it whatever you need. But its low level and
> >>> bit hard path as you need to make your own api.
>
> >>> Regards,
>
> >>> Ashvin
>
> >>> On Mar 31, 1:12 pm, sebastian de comocomo <[email protected]>
> >>> wrote:
>
> >>>> Hi Ashvin,
>
> >>>> I already check this:
>
> >>>>http://code.google.com/apis/ajaxsearch/documentation/reference.html#_...
> >>>> onje
>
> >>>> Is there a specific section for Curl &PHPthat I don't know of?
>
> >>>> Could you send me the link?
>
> >>>> Thanks,
> >>>> Sebastian
>
> >>>> On 30/03/09 21:37, "Ashvin Savani" <[email protected]> wrote:
>
> >>>>> Sebastian,
>
> >>>>> Use Curl library forPHP. That should help.
>
> >>>>> Regards,
>
> >>>>> Ashvin
>
> >>>>> On Mar 30, 5:23 pm, Sebastian <[email protected]> wrote:
> >>>>>> Hi everyone,
>
> >>>>>> I'm new to Contacts API, and I'm a bit confused.
>
> >>>>>> I managed to register my domain, and to get it granted, so that it
> >>>>>> returns me a url with a TOKEN.
>
> >>>>>>https://www.google.com/accounts/AuthSubRequest?scope=http%3A%2F%2Fwww...
>
> >>>>>> I don't know what I should do next. I usePHP, and in the google
> >>>>>> developer's guide, says we should use this:
>
> >>>>>> GET /accounts/AuthSubSessionToken HTTP/1.1
> >>>>>> Content-Type: application/x-www-form-urlencoded
> >>>>>> Authorization: AuthSub token="yourAuthToken"
> >>>>>> User-Agent: Java/1.5.0_06
> >>>>>> Host:www.google.com
> >>>>>> Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
> >>>>>> Connection: keep-alive
>
> >>>>>> Is thisPHP?
>
> >>>>>> How do I implement this on my webpage?
>
> >>>>>> I don't see any of your codes containing this.
>
> >>>>>> Should I use $_GET['token']  to get the token?
>
> >>>>>> Any guide would be appreciated,
>
> >>>>>> Sebastian
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Contacts API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-contacts-api?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to