Mark Pilgrim's PyBlogger wrapper, which is now being maintained by Brent Loertscher, looked to be the thing to try and get working. In the end this proved to be pretty easy...
PyBlogger sits ontop of the XML-RPC Python Library (
xmllibrpc.py
) which isn't included with the Series 60 distribution. I downloaded this and pushed it onto my phone using Bluetooth, installing it as a library using the Python Installer along with the lower level xmllib.py
which I grabbed from my laptop's Python 2.3 installation.
I then installed Mark's
blogger.py
library in a similar fashion, and fired up the bluetooth console on my Mac,>>> import blogger
>>> username = "USERNAME"
>>> password = "PASSWORD"
>>> blogs = blogger.listBlogs(username, password)
>>> myBlog = blogs[0]
>>> print myBlog["url"]
http://www.babilim.co.uk/blog/
>>>
Worked flawlessly. Can't really complain at that point. So I think my first project, just to get me used to the UI coding issues on the phone, will be a nice little app to let me blog directly from my phone. This is so much easier than Java ME...
This is really cool! It is neat to see that PyBlogger can be put to such a great use.
ReplyDeleteBrent
Thanks for this - I just did a trivial LiveJournal client this way (beamed xmlrpclib.py and xmllib.py over from a Mac, accepted them with "install as library", beamed over a short chunk of code with hard coded values, ran it from the menu, and it posted to a test journal.) "Just Works", even using HMAC/MD5 based auth (since md5.py is already on the phone.) It would have been further down my list, but when I saw the lj xmlrpc pages, a light went on, "wait, didn't I see an article about..." :-) _Mark_ http://www.thok.org/bloggery/
ReplyDelete