American in Spain

iTunes Enabled

November 24, 2006

My "What I'm Listening To" links on the left now go to iTunes Store when they can. This was made possible by a search page provided by Link Share, the company that runs the iTunes Affiliate Program. I figure that purchases will be more likely at the iTunes Store than at Amazon, where it used to link to. So go buy my current track! It's only $0.99!

The code that gets the link goes and runs a search on Link Share, parses the resulting page, and extracts the link to the iTunes store, all when you request the page on my blog. It caches the value in the database, and only fetches it again if my current song has changed. Actually, the link passes you through Link Share's site, so they can count your click and attribute whatever you buy to me. When it can't find the song on iTunes Store, it defaults back to Amazon. Although quite a few of my Spanish songs can't be found on either iTunes or Amazon. Oh well. It tells you in the tooltip that pops up when you hover on the link which vendor the link will send you to.

If you don't have iTunes, get it. It's fantastic!

I'm having trouble figuring out how I can bundle this magic into a Wordpress plugin to give out to the masses, since it depends so heavily on my hacked up version of the CG-Amazon plugin and is specifically tailored to what I wanted to accomplish with my current song listing.

Also, the iTunes links at the bottom of my blog entries are now randomized. There are 20 different ones that are chosen randomly for display. All of them were hand-chosen by me as artists or programs that I enjoy and endorse.

So get clicking!