Archive for March 2nd, 2005
Album Art
Wednesday, March 2nd, 2005
Been working on the playlist program in-between a giant project at school. Somehow I find this to be more useful than a primitive lexer and parser for Python. I have a feeling Python already has a great compiler, and the world doesn’t need a badly written one.
But I don’t think the world has seen this. At least not much. Basically, I’m searching for album art through Google Images, parsing the result page sent back for all image URLs in it, grabbing the images one at a time until I find one that’s square (to a tunable tolerance), resizing it to a specified size, caching it in a specified directory (with an optional maximum number of files cached, using a least-recently-played replacement policy), and returning the resulting image. Of course, if the album already has art cached, it doesn’t go searching; and if it can’t find anything on Google Images, it uses Froogle, which is more likely to have the image if the CD’s still on sale, but the images are lower quality. If neither Google Images or Froogle finds anything, it uses a specified default image.
Whew. It’s cool. Very cool. Take a look at the album art for the most recently played album.
Eventually this will be fully integrated into the playlist program, with the additional function to show a “bloglet” display for your sidebar or anywhere else. You’ll be able to simply tell it the width you want the bloglet to be (along with the margin for the images), the number of images to display, the configuration (eg: 4 images in a 2×2 block, or 6 images in a 2×3, etc), and the criteria (eg: most played songs, most recent albums, etc.). It will then produce a nice little DIV right into your page with images resized to fit. It will rock, to say the least. Expect more soon.







