问题
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