One Aging Geek

Thursday, December 29, 2005

DIY "podcast" for This American Life

If you can't afford to buy This American Life at between $4 and $13 per episode and you think that Audible is evil and you're running a relatively current Linux with MP3 and Real installed... then the script below will fetch TAL episodes. This presumes a "root" directory of $HOME/podcasts within which will be created directories named for the date (yyyy-mm-dd). Prerequisites:

  1. mplayer
  2. Real codecs
  3. LAME
  4. GNU "bc" calculator program

Setup:

  1. In the $HOME/podcasts directory create a file named "ThisAmericanLife.log". Add one line to it with the one lower than episode number with which you wish to start.
  2. Schedule the script to run nightly via cron
Operation:
  • When the script runs without any arguments it will extract the last line of ThisAmericanLife.log, add one to the value and use that as the episode number to fetch.
  • The RealAudio version of the episode is fetched and saved as a WAV using the mplayer program. This fetching runs in "real time" so fetching a one hour show takes an hour. Except sometimes it doesn't and downloads very quickly. No clue why. Some weirdness in mplayer.
  • After the WAV file is fetched it is converted to MP3 using the LAME program. The MP3 is tagged and stored in a directory named for the date and the WAV file is deleted.
Possible improvements:
  • Could scrape the website for the episode number. But then you'd get reruns. So it doesn't do that. If you seed the log file with the current episode number (minus one) then you'll only get new episodes with no reruns.
  • Could scrape the mplayer output and get the episode title.
Other features:
  • Just one so far. If you run the script with a numeric argument it will fetch that episode.
cd $HOME/podcasts

datedir=$(date +%Y-%m-%d)

episode=$1
if [ -z $episode ] ; then
      episode=$(echo $(tail -n 1 ThisAmericanLife.log )+1|bc)
fi
echo Fetching episode $episode

/usr/bin/mplayer -playlist http://www.thislife.org/ra/$episode.ram -ao pcm:file=tal$episode.wav -vc dummy -vo null

if [ -e tal$episode.wav ] ; then

      echo $episode >>ThisAmericanLife.log
      sort -n ThisAmericanLife.logtemp
      mv    ThisAmericanLife.logtemp  ThisAmericanLife.log

      if [ ! -d $datedir ] ; then
              mkdir $datedir
      fi

      /usr/bin/lame -V -vbr-new -h --add-id3v2 --tg Speech --tt "This American Life episode $episode" --ty 2006 --ta "Ira Glass" tal$episode.wav $datedir/tal$episode.mp3

      rm tal$episode.wav

fi

Friday, December 23, 2005

Critters in the attic, the rerun

I thought I'd blogged about round one with the critters in the attic but I can't seem to find it.

We've got another round of critters in the attic. Last spring for the first time in over twenty years in this house, we had some form of rodent move into the attic. I attribute this to no longer having an outdoor cat around the place. My first thought was rats but the pattern of activity didn't fit what I read about rats. We'd hear them only in the evening and at sun-up, as if they were coming in to the attic for a nice snug place to sleep and then heading out to be about their business. Regardless I bought a box of rat poison chunks and crawled up to distribute it. Saw definite signs. Crawled up a day later and found all the poison all. A few days later I found a dead squirrel outside the house. And we were critter-free for several months.

Round two started a couple of weeks ago but I've been too damn occupied to deal with it. Went up again a couple of days ago and distributed more poison. Now I'm just hoping that this round of critters had the decency to crawl outside before expiring like the last batch. I'd really hate to have rotting critter bodies in the attic with Christmas company coming over. Ugh.

Obsessing over the music collection

With some time off I decided to pick the nits and fleas off my music collection. It had gotten to be a mess. The bulk of it lives on my portable player with a backup copy plus seasonal stuff off on my Windows system. At least that's how I thought it was. Truth was that the player and the Windows copy had diverged. Most of my ripping has been done using grip on Linux. For a couple of years I ripped to Ogg Vorbis format. My portable player supports Ogg. But some of the music gets used in video projects and the software we use for those doesn't support Ogg. So in a fit of stupidity I did a mass conversion of all the Ogg files to WMA using dbPowerAmp Music Converter. Without going into too many boring details, I also did some renaming and retagging and other cleanup on one or the other copy of various tracks so I ended up with a hopeless mess with tracks in MP3, WMA, Ogg, FLAC and a few WAVs.

I think I've mostly untangled the mess I made. The following tools were of immense help:

EasyTag
A great tag editor and more. Very useful for mass tag cleanup with features like the ability to convert underscores to spaces. I can't say enough good things about this tool! But I wish that WMA support was built in. I've found some links to code that will add it but haven't spent the time to do that yet.
amaroK
An amazing music collection organizer and player. But frankly I have a love/hate relationship with amaroK. When it works it's wonderful! But amaroK (or possibly the underlying GStreamer engine) doesn't get along with my portable player when the portable is mounted as a USB drive. It glitches, like a skip on an old time record, every couple of minutes when playing tracks from the portable. Tracks copied to the ginormous external USB drive plays fine. After enough glitches amaroK just freezes up.
Good ol' Unix rsync
While it isn't wart-free (rsync to a WinXP samba-mounted onto Linux seems to always think the file dates are different. Update: Doh! after a bit of rtfm I came across the --modify-window option), rsync has been a great help. In particular the "--existing" flag lets me update tracks from the main collection to the portable player without trying to jam the entire collection onto the portable.

At this point the collection is all rationalized to my satisfaction and I found some stuff I didn't recall I had.

Update: I once knew that the FAT file system (used on my player) and apparently the NTFS system (used on my WinXP system) only store timestamps to a resolution of 2 seconds. That by random chance would cause half of the files to appear out of sync. The --modify-window=1 option to rsync handles this nicely.

Monday, December 19, 2005

AOL Coaxes Google to Try Busier Ads - New York Times

Users of Google's search engine will soon see something they are not used to on the notoriously spare site: advertising with logos and graphics. And the advertisers will not be limited to America Online, whose talks with Google prompted the change in policy, according to two executives close to the companies' negotiations.

As part of their deal, which is expected to be formally announced this afternoon, Google is providing AOL with $300 million worth of advertising on Google's Web sites, intended to use to draw Google search users to related content on AOL's sites, the executives said. That sum is on top of the $1 billion in cash that Google is to invest to buy a 5 percent stake in AOL.

Google could see just how easily people can desert it if it stays on this course.

Friday, December 16, 2005

Back to Firefox

Some time ago I wrote here (at least I think I wrote it here) that I was converting from Firefox to Opera. Firefox on both my Windows and Linux systems was taking many minutes to load, longer even than IE. One of the things that helped my decision to convert was the 10th anniversary free Opera keys, shortly followed by making Opera free.

But now I've gone back to Firefox.

I like Opera. A lot. But it has some flaws that are fatal to me.

  • Doesn't run GMail reliably.
    • There are some features that seem to just not work, like looking up contacts as you type addresses.
    • There are times when Opera gets "stuck" on a screen that says "Loading...". When that happens it can sometimes be jarred loose using a bookmarklet that causes a refresh (but not by using the refresh button), sometimes by clearing the cache and reloading, and sometimes it requires restarting down the browser and logging into GMail.
  • Doesn't run Outlook Web Access at all

    If my work (Windows) laptop isn't powered up but I want to have a look at work email, I have to use Outlook Web Access. This simply doesn't work in Opera. It works marginally in Firefox, enough to read and respond to mail.

  • Doesn't run Blogger

    Not much to say here. Most of Blogger gets disabled when used via Opera

  • Frequent crashes, especially with Bloglines

    Since I bounce around among several computers running multiple operating systems I've given up on deskto aggregators and am using Bloglines to track my reading. But if I get behind and there are a lot of unread items, Opera has a tendency to crash while loading the page. Other crashes in Opera aren't all that frequent but do occur often enough to be real annoying.

So the bottom line is that Opera has been once again relegated to the dustbin and I'm back on Firefox running the new 1.5 release.