Categories: Misc / DotNet / Java / Coder / Linux / PHP Ask - La ask - La Answer

iTMS Link-maker

This is beyond my ken, but I was wondering if any scripters out there had any idea on how to automate linking to songs in the ITMS? I'm sure that someone clever enough scripting Safari could pull it off; Apple's provided all the backend with the iTunes Music Store Link-Maker (http://phobos.apple.com/WebObjects/MZSearch.woa/193/wa/com.apple.jingle.search.DirectAction/itmsLinkMaker), and the url structure for a query is simple:

http://phobos.apple.com/WebObjects/MZSearch.woa/193/wa/com.apple.jingle.search.DirectAction/itmsLinkHits?
songTerm=song+title&albumTerm=album+title&artistTerm=artist+name

... where the "+" symbols take the place of whitespace. The problem is the page that gets generated.

This is the meat of what one would need to get to the next step:

<TR height="20" bgColor="#ffffff">
<TD WIDTH="236" HEIGHT="20">
<FONT SIZE="1" FACE="Helvetica,Arial,Geneva,Swiss,SunSans-Regular"> Clocks
</FONT>
</TD>
<TD WIDTH="17" HEIGHT="20">
<a href="/WebObjects/MZSearch.woa/193/wa/com.apple.jingle.search.DirectAction/pickITMSLink?songName=Clocks&searchType=1&artistNa me=Coldplay&plid=684888&id=684859
&playlistName=A+Rush+of+Blood+to+the+Head">

What needs to happen is the page needs to be search for that content, and then the stuff in bold needs to be put into a url with this structure:

itms://ax.phobos.apple.com.edgesuite.net/WebObjects/MZStore.woa/193/wa/
viewAlbum?selectedItemId=684859&playListId=684888

Not hard theoretically, but I have no clue on how to pull info from an HTML page with AppleScript.
[1707 byte] By [eustacescrubb] at [2007-11-9 14:54:17]
# 1 Re: iTMS Link-maker
Gimme An iTMS Search String! (http://www.malcolmadams.com/itunes/scripts/scripts04.shtml#gimmeanitmssearchstring) creates a link based on your choice of title, artist, album, and composer. However, it is not the same as Link Maker because that uses info from the ITMS that users can't get at...namely the artistID.

Also, when posting code, please try to use breaks and the [SIZE] tage to keep the page from expanding (c'mon, e!) :)
Doug Adams at 2007-11-15 17:24:59 >
[an error occurred while processing this directive]
[an error occurred while processing this directive]