O'Reilly logo

Flickr Hacks by Jim Bumgardner, Paul Bausch

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Hack #31. Back Up Photo Comments

Flickr photo comments are usually light chit-chat, but you might want to save them for posterity.

One of the key features of Flickr is that it enables its users to have conversations about photos on the site. When you post photos on Flickr, you're posting them not into an empty space, but into a space with lots of other members. Because Flickr is an interactive environment, your contacts and other viewers can not only view your photos, but also post comments about them, perhaps asking questions, offering praise, observations, or providing useful critiques. Figure 5-3 shows three comments under a photo.

Photo comments

Figure 5-3. Photo comments

Even though Flickr will be around for the foreseeable future, you might want to have your own personal backups of the comments that have been generated around your photos. The conversations about a photo are often nothing more than idle chit-chat, but as with any conversations, there may be times when you'll wish you had a copy to refer back to or search through, or just to have a record of what was said.

With a bit of Perl, some queries to the Flickr API, and some screen-scraping, you can create an archive of your comments. With the conversations stored on your own hard drive, you can search them and refer back to them as much as you'd like.

The Code

Unfortunately, Flickr doesn't give access to comments via its API, so this code ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required