The Flickr Authentication docs have said that authentication for mobile applications might be available in the future. Apparently the future has not yet distributed to Flickr. The authentication interfaces rely on punching out to a browser to give permission to the application. Pretty lame. Makes me wonder how ZoneTag manages to upload. I thought there was a simple post interface to Flickr at one point… I’m quite sure I developed against it at one point. I can’t find any docs about it now though, and the examples I have don’t seem to work any more.

The E61 I’m using includes the Nokia open source browser however, so I was curious if I could use it for the Flickr authentication API from a Python script on my phone. I would love to be able to take the card from my camera and upload the images on it over wifi from my phone without involving my laptop. I haven’t made the script run on it’s own yet, but here it is. I loaded both of the files in the zip (a hacked version of uploadr python tool, and a urllib2 I pulled out of my desktop Python install and removed stuff from till it loaded and ran without exceptions) into the lib directory of my python install and tested it out like this:


>>> import uploadr
>>> flick = uploadr.Uploadr()
>>> flick.uploadImage('e:\\Images\\miker.jpg')

It outputs a bunch of debugging info, and should startup the browser at some point and ask you to login and allow the app access to your flickr account. When it’s done, you should have a new photo up on the site. Getting the browser popped up was a bitch, apparently there’s a lot that’s changed in 3rd edition. I picked up the tip for how to do this from a forum posting somewhere:


def openurl( self, url ):
    browser = 'BrowserNG.exe'
    e32.start_exe(browser, ' "4 %s"' %url, 1)

What’s that 4 do before the url? Not really sure, but trying it without that number or with other numbers didn’t work at all. Also, I didn’t realize that P60 was up to version 1.3.13 until I hit the sourceforge download page directly. There are 3 or 4 pages that served as homepage for P60 over time, and the one I had bookmarked said 1.3.8 was the most recent. In 1.3.13 the library path problems seem to be fixed, so I would highly recommend grabbing the new version to avoid some annoyances that made debugging and testing pretty difficult.

It is kinda cool that the open source browser works well enough to perform the authentication. I’ll have to get the upload list stuff working again, and make sure it pulls images from the mmc card for my camera by default.