cleaning up after iTunes

cloudy, chance of sun breaks: pointing iTunes “now playing” links to either Amazon or iTunes:

I suspect an automated process could be implemented with a Perl script.

My goal would be to have ecto (where I craft these scintillating posts) drop in the correct Amazon link when I tell it to post what I’m listening to.

So this snippet that links to a Google search on the artist’s name:
now playing: Svefn G Englar from the album Agaetis Byrjun by Sigur Ros

becomes this which also takes you to the product page on Amazon.com:
now playing: Svefn G Englar from the album Agaetis Byrjun by Sigur Ros

As it happens, there’s a perl module ready-made for the task: Net::Amazon – Query amazon.com via SOAP:

Net::Amazon is a Perl module providing an object-oriented interface to amazon.com’s SOAP and XML/HTTP interfaces. This way it’s possible to create applications using Amazon’s vast amount of data via a functional interface, without having to worry about the underlying communication mechanism.

But I don’t see any sample code that suggests I can pass a CD name and/or artist’s name and get back the exact ASIN so I can fix my iTunes database.

More investigation is required. I’m sure someone has done this already or something close to it.