Google Plus API get photo albums/videos

最后都变了- 提交于 2020-01-01 06:56:04

问题


How can I get the Google Plus Photo Albums for a user or a page? I can get the activities (post/video/photo) all together.

This is the code I'm using:

var provider = new NativeApplicationClient(GoogleAuthenticationServer.Description);
provider.ClientIdentifier = GoogleIdentifier;
provider.ClientSecret = GoogleSecret;

ActivitiesResource.Collection collection = new ActivitiesResource.Collection();

var service = new PlusService();
service.Key = GoogleKey;
ActivitiesResource.ListRequest list = service.Activities.List(ProfileID, collection);

foreach (Activity activityFeed in list.Fetch().Items)
{
    var title = activityFeed.Title;
    foreach (Activity.ObjectData.AttachmentsData attachment in activityFeed.Object.Attachments)
    {
         if (attachment.ObjectType == "photo")
        {
            //add to list of photo
        }

        else if (attachment.ObjectType == "video")
        {
            //add to list of video
        }
    }
} 

This function gives the activity feeds. I need to get a list of all albums of a page.

I'm using google-api-dotnet-client.


回答1:


The Google+ API doesn't support direct access to albums and photos yet. What you can use is the Picasa Web Albums Data API (since this is where the Google+ photos are stored) using the same Profile/Page ID that you would use to access the Google+ API. https://developers.google.com/picasa-web/



来源:https://stackoverflow.com/questions/11370554/google-plus-api-get-photo-albums-videos

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!