recent listening system

Since it’s often a popularly-discussed feature on blogs, I thought I’d go over the newly-revamped “recent listening” section (to the right, in the sidebar). When I first implemented a similar feature, I used Kung-Tunes, a nice little AppleScript app that allows you to upload files to a server via FTP (and will now send an HTTP GET string, too) that listed recently-played tunes in iTunes. I then switched to an all-MT version that used trackbacks and a separate blog in my MT setup. I didn’t care for that solution as it didn’t allow me to easily manipulate the data entered.

Since I was already using Freshly Squeezed Software’s Recent Tunes freeware app to send the trackback pings via HTTP GET, I decided to create my own solution with PHP and MySQL, against using Recent Tunes to send the data from iTunes.

The current upload script just takes the data sent by Recent Tunes (which is configurable and based upon a small tag set) via the HTTP GET, munges the variables a bit, then puts the variables in a database (and adds a timestamp and location stamp — hover over an entry to see them in the “tooltip”). Another small PHP script retrieves the 5 most recent entries from the db and includes them on the page. Real easy and is the most flexible solution I’ve come across.

While there are several utilities that will allow you to transmit data from iTunes to a server, I stuck to Recent Tunes because it’s a neat little app (also has a menu item with some nice features) and is fairly unobtrusive.

I can’t believe I didn’t roll my own solution months (years!) ago. It’s given me more fuel to rolling my own (very simple) blogging tool that will meet my modest needs yet give me exactly what I want in a blogging app. We’ll see how it goes after I finish some humongous projects at work in the next few weeks.

UPDATE 2004.08.24: Thanks to a kick in the ass from Mat, I added a couple of other things to the system:

  1. Clicking on the song title or artist will search Google for that title or artist’s name
  2. Clicking on the iTMS link next to the song title, artist, or album info will take you to a search results page at the iTunes Music Store. If the search is successful (i.e., the info in the ID3 tag in my music collection is accurate and the iTMS has the music), you’ll be able to listen to and buy the music there.

UPDATE: 2004.10.16: code (and instructions)coming soon.