Google Plus API获取相册/视频 [英] Google Plus API get photo albums/videos

查看:105
本文介绍了Google Plus API获取相册/视频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何获取用户或页面的Google Plus相册?我可以一起获得活动(帖子/视频/照片).

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.

我正在使用 google-api-dotnet-client .

推荐答案

Google+ API尚不支持直接访问相册和照片. 您可以使用与访问Google+ API相同的配置文件/页面ID的Picasa网络相册数据API(因为这是Google+照片的存储位置). https://developers.google.com/picasa-web/

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/

这篇关于Google Plus API获取相册/视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆