Most of the social media websites have the facility to fetch the contacts in our address book. This is probably being used to find friends network. This is a simple php class based on Google’s client login API to fetch contact details someone’s gmail Id. Curl must be enabled in your server for the proper working of this library. You should also need to register your application to Google for authentication which is very simple and includes only two steps.
The following link helps you to register the website.
https://www.google.com/accounts/ManageDomains
If you require more information about Google Client Login API click here
To download the class file click here
Following sample code snipplet shows How to use the Gmail Contact Grabber library.
<?php /* * To change this template, choose Tools | Templates * and open the template in the editor. */ include "Gmail_contacts.php"; if( isset( $_POST['email_submit']) ) { // First parameter is the offset // Second parameter is the starting index. $grabber = new Gmail_contacts(1000, 1 ); $emails = $grabber->get_contacts( $_POST['email'] , $_POST['password'] ); } ?> <form action="<?=$_SERVER['PHP_SELF'];?>" method="post"> Email: <input type="text" name="email" /> <br> Password: <input type="password" name="password" /> <br> <input type="submit" name="email_submit" /> </form> <?php if( isset( $emails ) && count($emails) > 0 ): ?> <?php foreach( $emails as $email ): ?> <input type="checkbox" name="conttact[]" value="<?=$email['email'];?>" /> <?=$email['email'];?><br> <?php endforeach;?> <?php endif; ?>



Awesome scripts.
Thanks
after putting username and password it is showing “Access forbidden!,Error 403″. pls help me….
Did you register your website with google?
Thanks vasudev!!
Great!
Hello, cant make the script work, $response = curl_exec($ch); returns false, what could be wrong? please help
Did you register with Google ??
i didnt register, because i am running this script on localhost.. hmm
It wont work in localhost …You have to upload to the domain.
The script is awesome and very helpful.
But I also want to show error messages if authentication failed like if user enter wrong email or password.
Please help me on this
how to grab email from only email address and that email address’s address book?? any idea like facebook they sends email to registered email’s address book emails
This script works ….. What is the script for yahoo and hotmail?
este script funciona….. ¿cual es el script para yahoo y hotmail?
Hi nice script, perfect working well on localhost, good for integration with Kohana 2.3 and Kohana 3. any plans for a yahoo script will be helpful for me, will definitely keep an eagle eye on your articles.
thanks
how can i sent group scrap in orkut
thanx for nice script
Respected,
i used your code in my website but its not working properly. its always return NULL when i login and grant permission.
please help me…