Gold Plated Blog Posts
Whatev.
Monday, February 18, 2008

Lightweight PHP Picasa API Version 2.0

I haven't had a chance to post in a while, I've been busy preparing an update to the Picasa API I built for the Pictures section of this site. I didn't put a whole lot of effort into making the previous implementation much better than what I needed because I didn't think it would be worthwhile. However, it's been by far the most popular part of my site and I've received some good feedback on it. So now it's time to unveil version 2.0 of the Lightweight PHP Picasa API:

Download the API here.

In the new version I've focused heavily on documentation, because one of the gripes I heard from people was that it was tough to get something started. So I've added Javadoc style commenting to all the files included and will host the Javadocs here in a few days. Also to help things out, I've added several helper functions for doing things like retrieving an album or a photo, etc. So I think it will be much easier to get started if you're downloading it for the first time.

The two new classes I've added to the API itself are the Picasa_Author and Picasa_Comment classes. You probably haven't noticed, but I've started displaying comments on each photo (see this one, for example). I haven't got comment posting to work through the API yet, but at least now I can retrieve them. So the Picasa_Comments class holds comments and the Picasa_Author class holds authors. An author could be the author of an album or a comment, depending on the situation.

If you're already using version 1.0 of the software, don't worry, I've made this one fully backwards compatible. You should be able to replace version 1.0 with version 2.0 and your interacting code should need no update.

As always, if you have any questions or comments, let me know!

Update 04/09/2008: This post is for Version 2.0 of my Lightweight PHP Picasa API. Version 3.0 has since been released, which includes a great deal of expanded functionality. Go get it here for more Picasa PHP fun!

Comments

Cameron said...

Well I'm glad someone will be hotly anticipating the next release :)

Just to update everyone, the next version is coming along really well. I've just gotten accessing private albums to work (which was a lot tougher than you might expect...), and it's turning out to be a huge improvement over the current version. I'm working on it whenever I have free time and hope to have it ready in the next two weeks.

Posted Saturday, March 22, 2008 at 11:51 PM.
Anonymous said...

Hi,
Thanks for your reply! Sounds great! I will be lazy then and wait for your release ;-) Keep on the good work!
Greetings from Europe

Posted Wednesday, March 12, 2008 at 1:21 AM.
Cameron said...

Well, supporting private albums is sort of a tricky question. There is currently no method in the API that will facilitate Google's authorization process, so out of the box there is no way to do it. However, you can write something to request authorization from Picasa and then request a list of private albums. At that point, yes you could store those albums in the API's classes.

I've never needed to do authorization for my purposes until I added commenting to my photos a few weeks ago. Since I've done the work to do that, Version 3.0 of my API will include methods for authorizing an account, posting comments and photos, and I can include fetching non-public albums as well. I'm not entirely sure about a release date but I would think it will take me about a month to finish.

If anyone wants to be alerted when version 3.0 gets released, I don't have a mailing list set up but just send me your email address I'll be sure to send out a mass email once it goes online. I think it will offer a lot of improvements and make the API easier to use, and it will be fully backwards compatible with versions 1 and 2.

Posted Tuesday, March 11, 2008 at 12:22 PM.
Anonymous said...

Hi,
Seems to be a great API so far. One question: Does this work with non-public albums (as declared in Picasa web)?
Thanks

Posted Tuesday, March 11, 2008 at 2:32 AM.
The articles in this blog are authored by Cameron Hinkle, Software Engineer for Nike. The thoughts and opinions expressed are not shared by Nike or any of its affiliates.
Favorite links: