Archive for June, 2007

Juice-y Python

21 June 2007

I use Juice to manage my podcasts. But it doesn't do everything I need, and it's a little buggy, and I want to learn Python anyway. So I decided to download the latest source code and see if I could fix some of the bugs I've noticed and figure out how to extend it to do everything I need.

So step one was just getting to a point where I could compile it. The source code documentation is incomplete, so here's what I did, starting from scratch.

  1. Install Python 2.5.1
  2. Install pywin32 (I'm on Windows)
  3. Install mfc71.dll (needed by pywin32)
  4. Install py2exe (needed to compile Python source code to executable bytecode)
  5. Install wxPython (for the gui)
  6. Install pysqlite (may not be necessary, but I knew I'd need it eventually)
  7. Install NSIS (Nullsoft Scriptable Install System)
  8. Install NSIS FindProcDLL plug-in

PHEW!

Juice v.2.2.3.djm After all of that, it was actually fairly easy to build and install. However, I made the mistake of trying to upgrade the Universal Feed Parser, only to find that although Juice would still compile, install and run, it was silently crapping out while trying to read feeds so it would not actually update my podcasts. I reverted back to the version of UFP bundled with Juice and everything was fine (except for the UFP bugs I was hoping to have solved by using a later version, of course).

I should update this as things progress.

Quick WordPress Upgrading

21 June 2007

Note to self:

Grab a unified diff of the new version versus the old version:
svn diff -r HEAD --old http://svn.automattic.com/wordpress/tags/<old_version> \
--new http://svn.automattic.com/wordpress/tags/<new_version>

Apply the changes to the current installation:
patch -d <path_to_wp_install> -u -i <patchfile>

Leash and Feedparser

3 June 2007

Maybe I'll write up something a little more formal in the future. For now, I just want to publish this in case it's useful to someone.

Les Orchard posted a blurb that indicated that he was looking for a PHP class to perform HTTP requests with conditional GET support. Well, a while ago I was looking for that, too. Because I was working on a replacement for Magpie RSS (see below), I decided to use Snoopy as my HTTP client. I then wrote a brief extension, Leash, to provide a cache-enabled front end to Snoopy. Leash automatically caches the HTTP results, the time of the request, and the Last Modified and Etag HTTP headers. When you request a page you've previously requested, Leash first checks to see if the cached copy is older than the maximum cache age you've specified (or the default of 1 hour), and if the cache is too old, Leash performs a conditional GET. The latest version of Leash (which I bundle with Snoopy) is in my Subversion repository.

Also in that repository is my replacement for Magpie RSS. I always liked Magpie, but it didn't quite work for me and I also wanted an OPML parser. So I wrote one. Actually, first I wrote a generic PHP XML parser. Then I wrote the OPML parser and Feed parser.

Sorry, but I currently don't have time for documentation. Or support. That probably makes this of very limited utility to all but the most daring. If you're a PHP junkie, you'll probably be able to peruse the code and get the gist. And here's an example of how I'm using it to help manage my podcasts.