pieter michels

Github    Ask me anything   

March 18, 2011 at 7:42am

Home

Dropbox Photo Gallery

I’ve been working on a Dropbox-powered photo gallery site. I wanted to get rid of as much external services such as Flickr as possible. They do a very good job, have lots of features but I don’t want all my stuff to be spread across several services. But enough about ‘the why’.

The how.

I wrote a Sinatra application that’s able to import all the directories from your ‘Photos’ directory in Dropbox. (You do have the possibility the exclude some directories if you want). It uses the Ruby library from RISCfuture to communicate with the Dropbox API.

I installed it on my Linode server, and it’s quite easy to install it on your own server: you only need a basic Ruby setup and some knowledge about deploying a Ruby / Sinatra application.

My setup: nginx, Passenger and Ruby 1.9.2-p180.

The code is freely available on Github, so feel free to fork if you want to make some adjustments or improvements.

Blog_dropboxr

The idea.

Is simple.
You provide your Dropbox application and secret key, which directories you want to exclude and your database settings in the various ‘config/*’ files. When you first load the application you need to build the galleries after you authenticate with Dropbox. The Dropbox session keys will be saved, so the next time you want to rebuild the galleries you won’t need to authenticate again. 

For now, the importing functionality is limited: 

Once a gallery is imported you cannot update the photos in a gallery, even if your photo in your Dropbox directory is updated. I’m still working on this: the problem here is that Dropbox (or Mac OSX Finder / Explorer) doesn’t update the modification date of the parent directory when you edit a file.

The importing is limited to one level of directories. Like this:

Dsds

Update

You can now manage your galleries (delete them) through a small administration page and it has now some sort of disk caching.

 

Notes

  1. pieterm posted this