Garden Challenge '10

Harvested: $0.00
Profit: -$25.00

Recent Posts



October 2008
S M T W T F S
« Sep   Nov »
 1234
567891011
12131415161718
19202122232425
262728293031  


Monthly Archives



Links



Search


« | Home | »

Integrating Picasa Web Albums Into my Site with PHP

By Jonathan | October 28, 2008 at 5:37 pm

I like to think that I take a moderate number of digital photos, and I’m always looking to store them on my computer. I use iPhoto for organization, which I believe is a great application. I’ve always liked to share my photos online with friends and family (and whatever other creeps find the links), but I never could find a solid display method that did what I wanted (thumbnail page, higher res images, etc.). I used Photoshop for a while, which offers some decent page templates and automated creation of thumbnails and high(er) resolution images, but I still had to manually add a link from my page to the album page. I used Dreamweaver for a while, which also offers some decent page templates, but again, I was still stuck manually adding a new link to the new album page. In addition, none of the templates ever matched the template I used for the rest of the site; ie, there was too much manual work required!

I tossed around the idea of writing my own PHP script to pull images from a directory, generate thumbnails, create pages, etc., but it always seemed like too much work and I never got around to doing it. Anything I found online never did “exactly” what I wanted it to do, so I was never happy with any 3rd party solutions.

A while ago I finally gave up with Photoshop and Dreamweaver and decided that I would let Google handle all of my photo albums online. Using Picasa Web Albums has worked out very well, but there was never any integration between Lepolt.com and my Picasa Web page. A couple weeks ago I found out that Google [more or less] provides an API to Picasa Web. This is nothing new, I just had never heard about it. It’s not a direct API, but basically works by reading the XML feed that Google uses to store information about the albums and photos within. After Googling around a little and messing with some code, I finally developed a version that I was happy with.

It can be seen in production here: (http://www.lepolt.com/pictures.php).

For those interested, I will post the final version of my code. Please note that this code carries no warranty.
http://www.lepolt.com/blog/wp-content/uploads/2008/10/getpicasapics.zip

Additional links:
http://www.ibm.com/developerworks/library/x-picasalbum/
http://code.google.com/apis/picasaweb/developers_guide_protocol.html

Update: See this link for an updated version of the code for use as a WordPress plugin

Topics: code, do it yourself, google, review | 15 Comments »

15 Responses to “Integrating Picasa Web Albums Into my Site with PHP”

  1. Kevin Says:
    October 28th, 2008 at 6:36 pm

    I not only gave you the idea for using the XML from Google, but sent you both of those links. Where’s my credit?

  2. Jonathan Says:
    October 28th, 2008 at 6:56 pm

    I’d be more than happy to post your email address on the Internet!

  3. TKO Says:
    October 29th, 2008 at 12:28 pm

    I measured the load time of that page with a sun dial.

  4. Jonathan Says:
    October 29th, 2008 at 8:19 pm

    Sorry, in order to generate the random thumbnail images I cache the list of thumbs for each album in local cache files on the web server. The file I/O is the slow stuff…and if the cache file needs to be updated a new file needs to be created which will add some additional computation. All I have to say is it’s better than any PHP script on the web I’ve ever seen from you!

  5. Kevin Says:
    October 29th, 2008 at 10:53 pm

    How often are the cache files for each album created?

  6. Jonathan Says:
    October 30th, 2008 at 7:32 am

    Cache files are created each time a new album is created and whenever the timestamp for an album changes.

  7. Kris Says:
    November 3rd, 2008 at 9:43 am

    Where are all the photos of me?

  8. Daily Find #108 | TechToolBlog Says:
    November 3rd, 2008 at 4:07 pm

    [...] Picasa Web Album PHP Widget [...]

  9. Ryan Says:
    November 4th, 2008 at 6:11 pm

    Where’s the friendly user guide to go with your zip file???

  10. My First Try at a WordPress Plugin | Lepolt.com Blog Says:
    November 15th, 2008 at 3:30 pm

    [...] Integrating Picasa Web Albums Into my Site with PHP [...]

  11. Jonathan Says:
    November 15th, 2008 at 3:32 pm

    The code has been modified for use as a WordPress plug.
    See here for details.

  12. Lance Ingle Says:
    November 16th, 2008 at 4:23 am

    I have been playing with this code for hours. Everything drills down through the XML until it needs to write to the Cache file. It creates them fine but they are empty. Resulting in no thumbnails. Everything else works.

    Do you know what could cause this?
    Thanks Lance

  13. Picasa Photo Scraper Using GData « Code This Says:
    November 18th, 2008 at 11:21 am

    [...] colleague Johnathan has written a post discussing how to retrieve Picassa content with PHP and has also written a WordPress plugin for this purpose. Check them [...]

  14. Nick C Says:
    July 28th, 2010 at 9:32 am

    perhaps this is too varied for this comment, but i couldn’t find a contact section/link on the site.

    (1) i’m interested in downloading the picasa web album php widget. i’m assuming i can derive what i’d need from the word press plugin (or through your ‘additional links’), but thought it was worth the inquiry, anyway.

    (2) from lepolt.com/pictures.php, the ‘home’ link errors out. the only link TO that page that i ran into was on this post at “It can be seen in production here: (http://www.lepolt.com/pictures.php).”

    (3) in case it is of any interest, i developed a widget that (supposedly) works on any photo feed (RSS/Atom) and can be implemented in PHP or used as an HTML widget to show recent additions to a picasa web album, flickr stream, or any other group of photos from which a feed can be created. i have had some trouble with large picasa web albums.

    thanks for sharing this. i like the picasa web album integration!

  15. Nick C Says:
    July 28th, 2010 at 9:34 am

    oh…it can be found here:
    http://demo.chapmanit.com/picture_rss/

Comments