Google Plus Album Urls

后端 未结 1 953
误落风尘
误落风尘 2020-12-07 23:32

I am using google app engine to create a photo gallery site for all of the photos I have taken. The photos I would like displayed are on my google plus account in a public a

相关标签:
1条回答
  • 2020-12-08 00:29

    You can do this, but the answer is kind of a trick, since it's not done through Google+ per se.

    The Trick:

    To list all of the photos in a Google+ album use the Picasa Web Albums Data API. It's not at obvious that this is what should be done, but as I write this all Google+ Photos are Picasa photos.

    The relevant documentation for Picasa is under Listing photos in an album.


    The Answer:

    Basically, GET a page at

    https://picasaweb.google.com/data/feed/api/user/userID/albumid/albumID
    

    where UserID and albumID are the values for your Google+ album. That'll give you back some Xml, listing all the photos.


    The Explanation:

    It may not be obvious from the Google+ page how to find the userID or albumID.

    One method of finding the IDs is to navigate to the album you want on Google+, and plug in the long numbers from that Url into the above style.

    Concretely, for John "Maddog" Hall's photo album "Campus Party, Brasil - Second Edition", we'd convert the Url from

    https://plus.google.com/photos/115999964287637644901/albums/5659736500890118225
    

    to

     https://picasaweb.google.com/data/feed/api/user/115999964287637644901/albumid/5659736500890118225
    

    From there, you can parse the resulting Xml and list all the photos. Caption info, thumbnails, etc. is also available if you need it. The Urls of the images are under /feed/entry/media:group/media:content in the resulting Xml.

    I assume you know how to parse and read the Xml in Python.


    The Generalization:

    If you needed to be able to list all of the albums for a user, you would use a Url in the style below, again replacing userID by the number from Google+.

    https://picasaweb.google.com/data/feed/api/user/userID
    
    0 讨论(0)
提交回复
热议问题