Greasemonkey script: Pitchfork links

Last.fm links on Pitchfork I read a lot of record reviews over at Pitchfork, and when something sounds good, I usually jump over to Last.fm to listen to it, or to remind myself to check it out again later. For a long time, I've been meaning to write up a Greasemonkey script for Firefox to generate the Last.fm link for me, so I don't have to type it in every time. You know, because that's so hard.

Anyway, I'm working on an, ahem, not tremendously exciting project at work, so I finally got around to it. I went ahead and made it extensible for other links besides Last.fm, so it can do links to iLike and Wikipedia, too; others are easy to add if you're reasonably familiar with Javascript. The script adds the links right next to the album artwork, right below the links to Emusic, digg, del.icio.us, and so on.

I posted it on userscripts.org. I currently have a hundred or so back reviews to read, so hopefully I'll have saved net keystrokes by the time I catch up.

Update: added links to IsoHunt, Mininova, and the Pirate Bay, by request.  I can't test right now because I'm on Firefox 3 RC2 and Greasemonkey doesn't work there yet.  But you can get the new version right here for now.  I will update it on userscripts.org as soon as I get it tested.


Tags: , , , , , , , , , , ,
Comments (2)

Ceci n'est pas une pipe

Been playing with Yahoo! Pipes. I was intrigued by a Lifehacker post I saw a while back about creating your own master feed by pulling in feeds from around the web and squishing them together. So I did it.

My master feed now includes:

I also created a pipe for the posts by themselves, which I can use to import all of my posts into Facebook as notes (Facebook only imports items from one feed at a time). Kinda cool. I imagine there's more stuff out there to pull in, but it's a pretty good start.


Tags: , , , , , , , , , ,
Comments

Audio tagging, Web 2.0-style.

I decided I want to be able to tag my audio files. Not just tagging, like with ID3 tags, but you know, tagging, like you tag a flickr photo or a del.icio.us bookmark. Web 2.0 tagging.

I have a digital music collection of close to 800 albums. There are nearly 300 different artists represented across almost 9,000 individual Ogg and MP3 files. I typically listen to this collection over the network, using DAAP (see a previous post), or occasionally through a Samba share from my Windows machine.

It's getting a little hard to find things with so much music to look through. So I've built some playlists with mt-daapd that divide things up in various ways. It goes a long way - you can specify playlists based on any combination of metadata fields, date added, filename, bitrate, etc.

There are a few problems with this approach. First, they're hard to maintain; even if your files are scrupulously tagged (I use MusicBrainz, which handles everything except, inexplicably, genre), you usually have to remember to add new things to your playlists.

Second, it's not very flexible; if you want to group music by anything other than genre (say, region of origin, or "driving songs"), you're out of luck. This issue is complicated by the perverse decision to limit genres in ID3v1 to a predetermined list of 126 (often dubious) choices.

Third, it's not portable. Your carefully constructed playlists are only available to DAAP clients accessing your share. This defeats the main reason for building audio metadata right into the files themselves.

After struggling with this for a while, it seems clear that what I really want to do is to associate small bits of arbitrary metadata with each file, so that I can create playlists based on whether those bits are present or not. And it should be up to me to determine what the groupings are. I should be able to create playlists of my wife's favorite songs, songs written by Lennon/McCartney, songs that came out while I was in high school, songs by artists from other countries, songs that I've seen performed live… anything I can think of should be possible. In other words, I want to be able to tag — and I mean Web 2.0-style, baby — my music.

So I began to commandeer the "comment" metadata field for this purpose. It works beautifully - I fill in the comment field with a space-separated list of tags for a file. In mt-daapd, and in library-based clients like Winamp, I can create a playlist based on whether a particular string occurs in the comment field. And the tags stay with the file, where they belong.

Still, it's a little daunting to tag 9,000 audio files. So — and here's the fun part — I wrote a couple of tools in Perl to help me out.

The first one doesn't actually tag anything. I use it to help me figure out what tags I might want to add to a particular artist. Given a list of artists, it will go over to last.fm and get a list of the top tags for an artist using their excellent XML services. If you don't give it any artists, it will use the name of the current directory (a convenience for me, since I'm doing all this from the command line). It's called lastfmtags, it uses LWP, and if you love the GPL, you can download it right here.

lastfmtags:
$ lastfmtags C*
Fetching tags for CAKE...
alternative
rock
indie
alternative rock
indie rock
seen live
Cake
pop
favorites
fun
Fetching tags for Cage...
Hip-Hop
hip hop
rap
Def Jux
heavy metal
underground hip hop
underground hip-hop
hiphop
Power metal
metal
...

'Nuff said. Okay, the other one is called commentify, and it's the tool I use to bend the audio comment field to my will. At its core is Audio::TagLib, which is a Perl wrapper around the nifty taglib library. It's a format-independent audio metadata library, which means that it goes and figures out what kind of audio file it's dealing with and handles each type in its own special way, so you don't have to. And it means that this script should work, not only for MP3 and Ogg, but also, apparently, APE, FLAC, and Musepack.

commentify can do five different tagging operations: set, append, delete, clear, and list. And it can act on multiple files or directories. If you give it a directory, it'll perform that operation on all files it finds underneath that directory (including all subdirectories). So it's easy to tag a whole lot of files, especially in a well-organized library. It's GPL, too, and you can get it right here.

Note that it will not attempt to preserve tag order. If it does, it's by accident. And it will not tag a file with duplicate tags.

commentify:
# set tags for all files within multiple directories
# (replaces all comment fields)
commentify -s "rock indie canadian" Arcade\ Fire/ Metric/

# add a new tag to some files
# (leaves existing tags intact)
commentify -a "favorite" dir1 dir2 file1 file2

# delete a couple of tags from some files
# (leaves others intact)
commentify -d "blah yadda" dir1 file1

# clear all comment fields
commentify -D dir1 dir2

# list comment fields for all files found
commentify -l dir1 dir2

Ah, that's good stuff. Now I think I'll go create a playlist from albums with green on the cover, bands that are side projects, and songs about cheese.


Tags: , , , , , , ,
Comments (9)

Bad Behavior has blocked 53 access attempts in the last 7 days.