Main
Latest
- An Inconvenient Truth
- Furion Radio
- Hyves
- The Ultimate Search for Bourne on Linux
- Muti.co.za on Facebook
- muti now IRC and Jaiku enabled!
- urlTea
- "Environmentally Friendly" Electric Hand Dryers
- myXchange Meeting 25 July 2007
- PHP 4 out of the door
Archives
- June 2004
- July 2004
- August 2004
- September 2004
- October 2004
- November 2004
- December 2004
- January 2005
- February 2005
- March 2005
- April 2005
- May 2005
- June 2005
- July 2005
- August 2005
- September 2005
- October 2005
- November 2005
- December 2005
- January 2006
- February 2006
- March 2006
- April 2006
- May 2006
- June 2006
- July 2006
- August 2006
- September 2006
- November 2006
- December 2006
- January 2007
- February 2007
- March 2007
- April 2007
- May 2007
- June 2007
- July 2007
- August 2007
- September 2007
- October 2007
- November 2007
- December 2007
- January 2008
- February 2008
- March 2008
- April 2008
- May 2008
- June 2008
- July 2008
- August 2008
- September 2008
- October 2008
- November 2008
- December 2008
- January 2009
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. :)
Copyright © 2004-2009 Charl van Niekerk. All articles are released under the Creative Commons Attribution 2.5 South Africa licence, unless where otherwise stated.


0 Comments
Post a Comment