Sunday, February 12, 2006

Nevow Radio

nevow :: twisted :: music


As *everyone* knows, PyCon is just around the corner. I'm quite
looking forward to it, since I missed last year's. Not only that, but
I'll be visiting a good friend whom I haven't seen in 10 years.
However, my housemate is getting nervous -- she relies upon me
completely for all things technological. With respect to my forthcoming
two-week absence, the biggest source of her concern has been music.



Over the past 9 years, I have migrated all of my Audio CDs to hard
drive and then to to MP3 CDs/DVDs. However, this trend has slowly
undergone a partial reverse as my ancient file server (running a fresh
Ubuntu) has found new purpose in life: serving MP3s from it copious
free space. I also happen to be the only one around who understands and
can operate such things. My housemate really doesn't want to be without
music for two weeks.

Not wanting to leave my friend in the lurch during the conference and
sprints, I whipped up some python code to make it all better. First, I
wrote a little script that parses the iTunes Library XML file. This
allows me to now generate MuSE-readable playlist files for all of my
iTunes playlists with a single script (it seems that iTunes won't let
you batch-export all your playlists). With these generated, I wrote a
quick little Nevow app that globs these new playlist files and
interacts with MuSE (I wanted to run icecast, but it seems to only work
with ogg). All you have to do is select the desired playlist, hit
submit, and then open up the stream in iTunes. Selecting a new playlist
in the Nevow interface reloads MuSE and immediately starts streaming
the new choice.

This was absurdly easy to put together. And it's only two files: one
for the playlist generator, and an all-in-one .tac file for Nevow. It's
even got a virtual host monster plugged in, on the off chance that I
want to put this app on its own little local domain. It's little things
like this that really confuses me: what's the big deal about people
freaking out with Twisted and Nevow? This stuff is brilliant,
well-designed, elegant and makes perfect sense. When I read Guido's
comments about how Nevow/Twisted scares him, I was at a complete loss.
It can only mean that he (and others with the same views) simply
haven't taken the time to site down and actually *use* the stuff.

C'mon, guys -- tune in, already!


Now playing:
Yann Tiersen - Soir de fête

No comments:

Post a Comment