Nokia N900 sharing plugin hack using Gallery 3 Python Library

sjsipila

Joined: 2007-04-03
Posts: 11
Posted: Wed, 2011-10-19 22:38

Just a quick note if somebody else is using Nokia N900 to interact with Gallery3..
N900 has a pretty nice "Sharing plugin" system which allows sharing of pictures directly from the file manager or Pictures applications. There has been a sharing plugin for Gallery2, but now I finally got this working with Gallery3 using the REST API.

There is a experimental Command-Line sharing plugin available:http://tuomas.kulve.fi/blog/2010/03/02/command-line-sharing-plugin-for-n900/
(the plugin is available from maemo extras-devel repo)

I created a simple script attached here for the sharing plugin using Gallery 3 Python library, more info

The script can also be used as a simple stand-alone command-line tool to upload pictures to your gallery. Gallery credentials can be given as command-line arguments or saved with the script.

There were a couple of issues with N900 that were fixed:
1. To get the Gallery 3 Python library working with the version of Python on N900 there are small changes needed after installation. Three files of the library (import simplejson instead of json) need to be edited, see the attached script for details.
2. urllib2 on N900 throws HTTPError Exception for some reason after receiving HTTP status 201 response (item created OK) -> needed to hack around that

Anyway, the script seems to work OK for me now. Posting it here in case somebody has use for it, check the script comments for more details. Needless to say: this is an experimental hack, has not been tested and may destroy ALL your data so be careful.

EDIT:
I packaged the python script + the Gallery 3 Python library (libgal3) to maemo extras-devel repo -> it can be easily installed using the application manager on N900. After installation you just need to configure the sharing plugin with something like:
g3_share -i %s -o %s -s your.gallery.com -b /gallery3 -d "Test/Incoming Pics" -u g3_username -p g3_password

Leaving the g3_share script attached here but manual installation is no more needed.

AttachmentSize
g3_share.txt5.49 KB