Charl van Niekerk » Blog

Main

Latest

Archives

Powered by Blogger

Python Pownce API Library

I have been using Pownce for a couple of weeks now. Although I like the concept of mixing microblogging with files, images and links, I don't really like the design (in terms of the look and feel) of the site too much.

One major let-down was their apparent lack of an API. It turned out that they do actually have an API, but that it's "hidden". Their desktop client makes use of it though. Naturally, people started to reverse engineer it and now we have an open source Python Pownce library already available.

I checked out the latest sources from the subversion repository but disappointment awaited me. The library requires the use of the httplib2. Although there is a package for Ubuntu Feisty, there isn't one yet for Dapper it seems.

I then tried on FreeBSD. I managed to get the py24-httplib2-0.3.0.tbz package installed. Afterwards, it complained about ElementTree being missing, so I installed the py24-elementtree-1.2.6 package but it still complains:

[charlvn@nebula /usr/home/charlvn/temp/pypownce]$ python pownce.py
Traceback (most recent call last):
  File "pownce.py", line 32, in ?
    import xml.etree.ElementTree
ImportError: No module named etree.ElementTree

I guess there must be something wrong with the package. I then created a little script to see if I could use ElementTree on Dapper. I installed the python2.4-elementtree package and also no luck. Really weird.

I wish I had more time to hack on this right now but I have some script.aculo.us drag-and-drop thing to work on now. Will post again if I get success. Any advice would be highly appreciated though.

Update: I used Google Code Search and tried replacing import xml.etree.ElementTree with from elementtree import ElementTree. Worked great on both FreeBSD and Ubuntu. I also had to replace import email.encoders with import email.Encoders and then every occurrence of xml.etree.ElementTree with ElementTree further down in the script. I dunno wtf is up with email.mime.base (actually email.mime in general) or which would be the right package to install for that. I installed py24-email-3.0.1 on FreeBSD but no luck. I searched on Google but it seems like everybody is using the same old email.mime.base. Bah. Luckily py24-feedparser-4.1_2 sorted the feedparser dependency. I just commented out the mime.base nonsense and managed to retrieve some of my profile data using the library. Now just to figure out how to post new microblog items. :)

0 Comments

Post a Comment

Copyright © 2004-2009 Charl van Niekerk. All articles are released under the Creative Commons Attribution 2.5 South Africa licence, unless where otherwise stated.