开发者

Get all photos from Picasa by person

Is it possible to get all photos by a persons name through the Picasa Web Albums Data API?

All examples I can find, shows开发者_运维技巧 how to get photos by an albumid.


You can request a list of the most recent photos, with a very high value for max-results.

I'm not sure if you are using the .NET API Client Library, but if so, an example is here: http://code.google.com/apis/picasaweb/docs/1.0/developers_guide_dotnet.html#ListRecentPhotos

Use query.NumberToRetrieve to set the value for max-results.

If you are not using the .NET Client Library, an example using HTTP protocol can be found here: http://code.google.com/apis/picasaweb/docs/2.0/developers_guide_protocol.html#ListRecentPhotos


You can retrieve facial recognition data from the Picasa Web API through a (currently) undocumented API URL that is used by the Picasa desktop application. More info here:

http://klick.com/pharma/blog/2011/09/retrieving-face-tag-data-from-the-picasa-web-api/


by setting "default" that mean retrieving current user with that code you can retrive the user photos in specific album

PhotoQuery query = new PhotoQuery(PicasaQuery.CreatePicasaUri("default", albumId));
        PicasaFeed feed = picasaService.Query(query);

        foreach (var entry in feed.Entries)
        {
            PhotoAccessor photoAccessor = new PhotoAccessor((PicasaEntry)entry);
            Photo photo = new Photo();

            photo.Title = photoAccessor.PhotoTitle;
            photo.Summary = photoAccessor.PhotoSummary;
            photo.MediaUri = entry.Content.AbsoluteUri;
            photo.Id = photoAccessor.Id;
            photo.AlbumId = photoAccessor.AlbumId;

            photos.Add(photo);
        }


If you know the subjectid then using an RSS link you can get a feed of ALL images for that user regardless of albums. The link is:

http://picasaweb.google.com/data/feed/base/user/PICASA_USERNAME?alt=rss&kind=photo&subjectids=SOME_BIG_LONG_STRING_OF_CHARACTERS

Also, you can find the subjectids by going to each person on PWA and clicking the RSS link at the bottom of the page.

I am stil trying to find a way to get all subjectids without a manual lookup.

Source: http://credentiality2.blogspot.com/2010/02/picasa-gdata-api-and-face-recognition.html

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜