FotoBilder LiveJournal photo gallery Python bindings

In order to move my photo gallery to LiveJournal, I needed to import lots of photos. This is doable one-at-a-time on the web, but like all good web apps, FotoBilder (which is the software that runs pics.livejournal.com) has an API which you can work with. There don’t seem to be any Python bindings, though, so I’ve written some. Go get fotobilder.py. Note that it’s not a complete implementation; I’ve only provided the stuff I need (UploadPic, UploadPrepare, a few other things). There are some niceties about it, like that you never have to worry about handling challenges because it does all that for you. Nonetheless, it seems to work for what I needed it for.

You’ll also need to get ProgressReportingHTTPConnection.py. This is a modification of the HTTPConnection object in Python’s httplib, which is part of the standard library, so that it can report progress on uploads. If you need to use httplib to send data to a remote server and you want a progress bar, using ProgressReportingHTTPConnection.py makes it easy. Simply use it like httplib.HTTPConnection but pass a function to the constructor as progress_callback; httplib will call your function with every 2KB of upload done.

Update: licenced under the GPL v2.0.

One Response to “FotoBilder LiveJournal photo gallery Python bindings”

  1. [...] as days pass by scratched tallies on the prison wall « FotoBilder LiveJournal photo gallery Python bindings [...]

    as days pass by » Blog Archive » fspot2lj - export F-Spot photos to your LiveJournal photo hosting

Leave a Reply

OpenID is a decentralised authentication system. If you use LiveJournal or Vox you already have an OpenID; just use the URL of your homepage there. See also how to get yourself an OpenID.