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 #42. Build a Custom Upload Script

If the existing Flickr upload tools aren't your cup of tea, try brewing your own upload script.

The Tools page at Flickr (http://www.flickr.com/tools/) points to a number of different programs that are available to help you upload your photos to Flickr [Hack #5] . Many include some extra features, such as the ability to add tags, set photo privacy options, and resize photos. But if the existing tools don't quite fit with how you want to upload photos, you can create your own upload program, thanks to the Flickr API.

Say you perform a certain number of steps for each photo that you upload to Flickr. With some automation, you should be able to combine those steps with the upload procedure, saving you time in the process. This hack shows how to put together a custom upload script that resizes photos and adds a copyright notice before sending them off to Flickr. You can adapt it to suit your needs.

Authorizing Your Script

The first step to creating a custom upload script is giving your script the authority to add photos to your Flickr photostream. The Flickr API has a user authentication system [Hack #40] that makes sure only authorized programs can add, edit, or delete photos at Flickr.

The key to authorizing your own script is requesting an authentication token—a string of characters that represents your unique combination of user ID and API key. You'll also need a special string called a shared secret, which you can pick up when you configure ...

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