How can I add a "what's playing in iTunes lately" widget to my blog if I'm a Windows user?
March 1, 2004 1:48 AM   Subscribe

How can I add a "what's playing in iTunes lately" widget to my blog...if I'm a Windows user? There's Kung-Tunes, but it requires using OSX and AppleScript, and our own Fearless Leader has a Trackback-based solution, but it requires using WinAmp with the DoSomething plugin. iTunes stores its info in an XML file in the Windows version (presumably the Mac version too?), so it should be just a matter of getting the relevant info. out of the file and online in some method, whether by FTP or passed as values in a URL or whatever. Bonus points if the solution can somehow be combined with Adam Kalsey's MTAmazon plugin for Movable Type to pull album art, release date, and other details about the embarassing stuff I listen to.

And by "embarrassing" I mean that I just bought Styx's greatest hits.
posted by Asparagirl to Computers & Internet (17 answers total)
How about WMPtunelog?
posted by snowgoon at 3:38 AM on March 1, 2004

Or Listen-to?

Neither are exactly what you are looking for I guess. There are other plug-ins which will write the 'currently' playing info to a text file which could then be parsed and... ohh all a bit technical for me. I'm sure someone is working on one somewhere though..
posted by snowgoon at 3:40 AM on March 1, 2004

Thanks for mentioning Kung-Tunes, since that inspired me to actually get it running on my site just now. And speaking of embarrassing... now the world will know that I bought Meco's disco Star Wars theme!

Blogtunes is supposedly like Kung-Tunes, only in Java, so you might check that out.
posted by litlnemo at 6:32 AM on March 1, 2004

I wrote a (very small) Perl script that gets the "most recently played" info from the iTunes XML and posts it. Not user friendly, but it's easy and yours if you want it.
posted by brool at 9:08 AM on March 1, 2004

I don't know if the iTunes on windows api has anything developers can use, but so far I haven't seen anything that can do much with iTunes (do they even have a plugin architecture for the windows program?).
posted by mathowie at 10:05 AM on March 1, 2004

There are the IPodManager and IPodService interfaces installed, but I've found those less than useful, they seem to mostly deal with transferring files to/from the iPod and such. For updating recently played or somesuch, you could just watch for changes on the iTunes XML file, iTunes writes it an updated list every time it finishes a tune.

I've seen plugins for visualizers, though -- I guess you could write a visualizer that would post to the blog automatically, or something, which would be kind of cool.
posted by brool at 10:48 AM on March 1, 2004

Response by poster: Thanks for all the responses so far! WMPTunelog requires posting via the Zempt or w.bloggar systems, so that's out. Listen-to ain't quite right either. Blogtunes seems promising and I'm going to give that a try, though it's not as full-featured as I'd like. But I did find an instance at scriptygoddess where Blogtunes was combined with a number of MT plugins, including MTAmazon, to give more information.

Brool, your script sounds great, but what I really need from it is the following:

1) must work okay on WinXP (preferably without me having to download perl and run it in the background all the time--could you turn your script into a .BAT or .EXE file?)
2) must pass four variables: song name, artist name, album name, last played on. Optional: number of times played, rating, year, genre.

Once I've got those posting through a web interface of some sort--even if it's just to a plain web page and skipping all the blog stuff--I can include the page on my blog with PHP and/or do the MT plugins magic later on.

Matt, I don't think iTunes for Windows has a real plugin architecture (yet), but the WMPTunelog "plugin" was diguised as a visualization and showed up in the visualizations menu, so that seemed to be a way around that.
posted by Asparagirl at 11:44 AM on March 1, 2004

Response by poster: I got it working! Here's what I did:

1) Set up a new blog called iTunes. Set up a new CATEGORY in that new blog, also called iTunes. Turned on the ability for that category to accept trackbacks, and noted the TB URL for the category. Created a new index template. Would like to post the code for that template here for other peple to use, but it doesn't seem to work without breaking Metafilter. E-mail me if you want it.
2) Downloaded Blogtunes. Unzipped it. Put it in c:\Program \Files]Blogtunes. Configured it (just needed to change two lines in the config file, one of which was the TB URL copied from above).
3) Started Bloglines and left it running minimized
4) Started iTunes, played some music
5) Pulled that new index template I made before into my main blog template using PHP.
6) Enjoy! (See sidebar on my site and laugh at my taste in music.)

Note: iTunes only registers "the last time you played a song" as "the last time you played a song ALL THE WAY TO THE END", so if you click away from a song before the end, iTunes' library won't count it, and therefore Blogtunes won't pick up on it, and therefore won't ping your site.
posted by Asparagirl at 4:54 PM on March 1, 2004

Response by poster: Aieee! Note to self: learn to spellcheck and proofread your posts, dammit! Hope that comment above was semi-understandable.
posted by Asparagirl at 4:56 PM on March 1, 2004

hey, I didn't realize that iTunes saved its data to an XML file... this is really cool -- I think I'll code up an app that will upload new songs to a webserver... with a GUI and everything, ooh!

if anyone has any advice about working with the XML file, please email me. the only problem I foresee is that my file is about 2MB, and the "recently played" list is right at the end, so I'm going to have to zip through the file until I find the correct key. boo-urns! it would be nicer if it saved each playlist individually.

hopefully I'll have this done by the end of the week. any other requests? it'll likely post an XML file to your webserver.
posted by krunk at 10:15 PM on March 1, 2004

any other requests?
Just one - post it somewhere we can steal it.
posted by dg at 1:34 AM on March 2, 2004

Oh, Blogtunes worked for you! Excellent!

Note: iTunes only registers "the last time you played a song" as "the last time you played a song ALL THE WAY TO THE END", so if you click away from a song before the end, iTunes' library won't count it, and therefore Blogtunes won't pick up on it, and therefore won't ping your site.

Hmm. That doesn't seem to be the case with Kung-Tunes. It's uploading the current song as it plays. I wonder if the difference is in Mac iTunes or in the Kung-Tunes program. Anyway.
posted by litlnemo at 2:25 AM on March 2, 2004

the iTunes XML file definitely seems to only get updated when it hits the end of a song. also, this may be one of the several reasons why iTunes is so slow. Having to update a giant XML file constantly isn't cool.

I'll post here and email you all when my app is done.
posted by krunk at 7:47 AM on March 2, 2004

well, it's still in progress, but when it is done, I'll post it to

wow, this is harder than I thought. iTunes is really inconsistent with its xml files... if anyone has experience with it, please email me!
posted by krunk at 4:54 PM on March 5, 2004

Response by poster: Hang in there, Krunk! My Blogtunes "solution" turned out to stop working that well less than two days after I initiated it (newer pings aren't showing up, phooey), so anything newer and better would be most appreciated.

Maybe post a new AskMetafilter post (pointing to this one for reference) and ask for good XML tips and reference sites?
posted by Asparagirl at 12:25 PM on March 7, 2004

Response by poster: By the way, I love the name you picked out for the new app. :-)
posted by Asparagirl at 12:26 PM on March 7, 2004

Phew, first version is done!
Dig it here...

I put off doing my thesis for a week to work on this! Making this is quite possibly the nerdiest thing I have ever done. Enjoy!
posted by krunk at 9:47 PM on March 8, 2004

« Older Sting's Instrument   |   Film still publication rights? Newer »
This thread is closed to new comments.