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.

More in the discussion (powered by webmentions)

  • (no mentions, yet.)