简体   繁体   中英

How do i get About ME Data of user from Google?

How can I get "About Me" data from Google Plus or Google profiles using PHP API? I want to get user name, location, about me etc (the information displayed on the user's screen). Also I want to get its feeds. Please help me with or without code.

You should start with the Google+ PHP quickstart sample to see how to connect a user to your application using the Google+ API and then perform API calls. The relevant API call for retrieving a user's profile data is plus.people.get('me') - in PHP it is:

$user = $plus->people->get('me');
error_log($user['displayName']);                                                    

As far as "feed" data is concerned, the Google+ API allows you to retrieve the public activities for a user using plus.activities.list. In PHP the API call would be:

$activities = $plus->activities->listActivities('me', 'public');
error_log('Activities are: ' . print_r($activities,true));

Note that the data you are retrieving in both these cases is going to be restricted to what that user has made publicly visible.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM