how to collect contacts from different accounts - php

so i was wondering this: for example: when you subscribe to Facebook you have the option to invite your friends from gmail(if you have a gmail account), so you would enter your gmail login and password and facebook would grab all your contacts from gmail, so i was wondering how this is done? is there an API from Gmail or from Hotmail that permits to program this?
thanks

These sites don't use an all-encompassing API, they take your login you provide and from their side login to Google (for example) as you and scrape it for your contact info.
This is why you should also be very careful about who you trust with that login information.

yes .There r different API's for all of these.you can download them by simply typing contact fetcher script in Google or something like this. They r free.
refer link https://sourceforge.net/projects/contactgrabber

There might not be an API specifically for it, but it's still pretty easy. I did something similar with PHP, using CURL to log in to a website and download reports automatically.
edit: You should be aware that some sites won't like that you do it, and might sue you for it. Always get a permission from the site owner before you try it.

Related

Google Hangouts in my website as a chat/messaging system

I currently have Google OAuth 2.0 for authentication. Next I want to be able to use google hangouts in my website so users can chat with each other, along with showing their contact list. So basically I want it to look like how it is on gmail but on my website for hangouts. Main reason for doing this, I want my users to be able use hangouts as a mode of communication. Please let me know if this is possible and provide the necessary resources, an example/demo of this working would really be helpful.
Im afraid there's no API at the moment available (nor plans for that) to access the text chat feature of Hangouts.
yes, you can. More information about google hangouts API here https://developers.google.com/+/hangouts/getting-started

Google OAuth to remember chosen account

I've implemented Google OAuth 2.0 login on a site that I'm working on. It works fine, except in situations when the user is logged with two or more different accounts on the same browser. It's asking him to choose which one he want's to use. But it's asking the user every time to choose the account. Is there a way to remember this, so the user can choose the account only the first time and later automatically to log him with that account?
You can put hd=domain.com parameter in the request to Google, but that only helps if the two logged accounts are from different domains and it can than log the user in with #domain.com account.
I read somewhere that you can send user_id account as a parameter to Google (I guess that would be the email address), but in this case I don't know the users email address before he logs in.
I think this behavior is the same if you use OpenID.
I'm using Google's PHP OAuth library.
Thanks,
Andrej
Google should have a cookie set that enables OAuth applications to tell what account to currently use.
If you know the email address you want to log in with, you can use the login_hint parameter and they won't see the account chooser. See https://developers.google.com/accounts/docs/OAuth2Login#sendauthrequest

How do I prompt a user to import their yahoo contacts list upon clicking a form?

I am trying to have a user sign up for a service via a PHP form and upon successful validation of their yahoo email prompt them to allow my application access to their contacts list (i.e. import the list) and ask them to send a message to their contacts.
Unfortunately I don't really know where to start, the code samples on the yahoo site itself are a little bit too advanced and not direct enough.
Can someone point me to a similar code sample or sketch out quasi-code? I want to actually learn how to do this...so i don't want ready made scripts to download...unless they are a tutorial/other pedagogical resource...
Thanks!
You can start here (official)
But this is the best I found so far Grab Yahoo! at phpclasses.org.. (you need to be a registered user to access file). There are download links at the bottom of page.
Try keywords like "php grab yahoo contacts" in Google for more solutions.

Google Contacts Data API and PHP

I'm developing a PHP application to retrieve the list of contacts from a GMail account. I'm looking for a solution which would enable the user of my application to provide the login and password to their Gmail account in my application (as opposed to getting redirected to Google) and then automatically do the retrieval. The retrieval process can be run in PHP or JavaScript (which would then feed the list of contacts back to PHP using Ajax).
Is it possible to do that? Which JavaScript API should I use for that? Can someone point me at the right chapter in Google Contacts Data API documentation?
This is really not advised - google provide OAuth for a reason - so that users won't have to give their credentials to 3'rd parties.
Check out http://code.google.com/apis/accounts/docs/OAuth.html
Speaking only for my self (and all other developers I know), having to hand over my credentials to 3'rd parties is a real no-no.
It would be best to use the Google Contacts Data API using JavaScript for your case.
I haven't tested it myself but it looks nice: http://gmail-lite.sourceforge.net/wordpress/
//edit:
You probably should use: http://code.google.com/apis/contacts/

How do I invite people from MSN, Yahoo into my application?

I need to add an invite users functionality to my social networking application so users can invite contacts from their hotmail or yahoo accounts. How do I do this and are there any free open source libraries that do this?
Depending on the service you wish to get the contact information from they might already provide a published API for you.
For example, Yahoo has a contact list API you could use: http://developer.yahoo.com/social/rest_api_guide/contact_api.html
Google also has one: http://code.google.com/apis/contacts/
And so does Windows Live: http://msdn.microsoft.com/en-us/library/bb463974.aspx
If you need something to work with a service without an API then you might have to ask that user for his username and password, use it temporarily to log into his account, download the contact information and then discard the login details. There are obvious privacy and security issues with this approach, however. Nevertheless, it is used quite frequently by many social networking sites.
The same approach can also be used to retrieve buddy information from instant messaging services. You log in (perhaps using an open source IM API) and get their buddy list and contact details.
Just in case anyone was interested - I would like to share this neat piece of code I found off the web. Its free and very easy to setup and integrate. http://openinviter.com is php based and you can extract email contacts from just about any address book there is.
You just need to have curl set up for this.

Categories