问题
Is there a way to get the profile picture for a google+ account by using an URL ?
I know that we can get the photo by doing something like: https://plus.google.com/s2/photos/profile/1234567890?sz=200 and I need something similar to get the profile cover photo.
回答1:
It depends on the URL you have, if you have the user's Google+ ID, you can then retrieve their profile, which contains a link to their profile. An example:
Api Explorer Demo of Retrieving a Cover Photo
Set the fields value to cover/coverPhoto/url
if it's not getting added automatically.
回答2:
There is not a link to access profile photos through the Google+ API. The best way to do this would be to make a GET request to the people.get API endpoint, as follows:
GET https://www.googleapis.com/plus/v1/people/{userId}
That will return a Person resource, which will contain the user's profile image under the id image
.
来源:https://stackoverflow.com/questions/19055914/get-google-plus-cover-url-by-user-id