itunes_link_maker 1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,69 @@
1
+ require 'rubygems'
2
+ require 'open-uri'
3
+ require 'cgi'
4
+ require 'hpricot'
5
+
6
+ require File.join(File.dirname(__FILE__), 'result')
7
+
8
+ class ItunesLinkMaker
9
+ MEDIA = [ 'all', 'music', 'movie', 'shortFilm', 'tvShow',
10
+ 'musicVideo', 'audiobook', 'podcast', 'iTunesU' ]
11
+
12
+ COUNTRIES = [ 'AU', 'AT', 'BE', 'CA', 'DK', 'FI', 'FR', 'DE',
13
+ 'GR', 'IE', 'IT', 'JP', 'LU', 'NL', 'NZ', 'NO',
14
+ 'PT', 'ES', 'SE', 'CH', 'GB', 'US' ]
15
+
16
+ SEARCH_URL = "http://ax.phobos.apple.com.edgesuite.net/WebObjects/MZStoreServices.woa/wa/itmsSearch"
17
+
18
+ TYPE_INDICES = { 0 => :name, 1 => :album, 2 => :artist }
19
+
20
+ OPTION_ORDER = [ 'WOURLEncoding', 'lang', 'output', 'partnerId', 'LS_PARAM', 'country', 'term', 'media' ]
21
+
22
+ @default_options = {
23
+ 'media' => 'music',
24
+ 'country' => 'US',
25
+ 'WOURLEncoding' => 'ISO8859_1',
26
+ 'lang' => '1',
27
+ 'output' => 'lm'
28
+ }
29
+
30
+ def self.default_options
31
+ @default_options
32
+ end
33
+
34
+ def self.search(query, options={})
35
+ html = get_html(query, default_options.merge(options))
36
+ parse_html(html).uniq
37
+ end
38
+
39
+ def self.quick_search(query, options={})
40
+ search(query, options).first
41
+ end
42
+
43
+ private
44
+ def self.parse_html(html)
45
+ doc = Hpricot(html)
46
+
47
+ result = []
48
+ (doc/'a.searchResults').each_with_index do |element, i|
49
+ name = element.inner_text.strip
50
+ type = TYPE_INDICES[i]
51
+ url = element['href']
52
+
53
+ result << Result.new(name, type, url)
54
+ end
55
+ result
56
+ end
57
+
58
+ def self.get_html(query, options={})
59
+ open(url_for(options.merge('term' => query))).read
60
+ end
61
+
62
+ def self.url_for(options)
63
+ "#{SEARCH_URL}?#{serialize(options)}"
64
+ end
65
+
66
+ def self.serialize(options={})
67
+ options.sort_by { |k, v| OPTION_ORDER.index(k) }.map { |k, v| "#{k}=#{CGI.escape(v.to_s)}" }.join('&')
68
+ end
69
+ end
data/lib/result.rb ADDED
@@ -0,0 +1,34 @@
1
+ class ItunesLinkMaker
2
+ class Result
3
+ URL_ROOT = "http://ax.phobos.apple.com.edgesuite.net"
4
+
5
+ attr_reader :name, :type
6
+
7
+ def initialize(name, type, display_url)
8
+ @name = name
9
+ @type = type
10
+ @display_url = "#{URL_ROOT}#{display_url}"
11
+ end
12
+
13
+ def url
14
+ @url ||= get_url
15
+ end
16
+
17
+ def eql?(result)
18
+ vars = [ '@name', '@type', '@display_url' ]
19
+ vars.all? { |v| instance_variable_get(v) == result.instance_variable_get(v) }
20
+ end
21
+
22
+ alias_method :==, :eql?
23
+
24
+ def hash
25
+ "#{@name}#{@type}#{@display_url}".hash
26
+ end
27
+
28
+ private
29
+ def get_url
30
+ doc = Hpricot(open(@display_url))
31
+ (doc/'textarea a').first['href']
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,490 @@
1
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
2
+ <HTML>
3
+ <HEAD>
4
+ <meta http-equiv="content-type" content="text/html; charset=utf-8">
5
+ <STYLE TYPE="text/css">
6
+
7
+ A {
8
+ text-decoration: none;
9
+ }
10
+
11
+ A:link {
12
+ color: #3366cc;
13
+ text-decoration: none;
14
+ }
15
+
16
+ A:visited {
17
+ color: #663399;
18
+ text-decoration: none;
19
+ }
20
+
21
+ A:active {
22
+ color: #cccccc;
23
+ text-decoration: none;
24
+ }
25
+
26
+ A:Hover {
27
+ text-decoration: underline;
28
+ }
29
+
30
+ BODY, TD, CENTER, P {
31
+ font-family: Geneva, Verdana, Arial, Helvetica;
32
+ font-size: 10px;
33
+ color: #333333;
34
+ }
35
+
36
+ .body {
37
+ font-family: Geneva, Verdana, Arial, Helvetica;
38
+ font-size: 10px;
39
+ color: #333333;
40
+ }
41
+
42
+ .content {
43
+ font-family: Arial, Helvetica, sans-serif;
44
+ font-size: 11px;
45
+ font-weight: normal;
46
+ color: #000000;
47
+ }
48
+
49
+ .title {
50
+ font-family: Helvetica, Arial, sans-serif;
51
+ font-size: 10px;
52
+ font-weight: normal;
53
+ color: #000000;
54
+ }
55
+
56
+ td.searchResults {
57
+ border-style: solid;
58
+ border-right-width: 1px;
59
+ border-color: #cccccc;
60
+ }
61
+
62
+ div.searchResults {
63
+ margin: 0px 5px 0px 5px;
64
+ color: black;
65
+ }
66
+
67
+ .searchResults a {
68
+ color: black;
69
+ text-decoration: none;
70
+ }
71
+
72
+ .sr_goButton img {
73
+ vertical-align: middle;
74
+ }
75
+
76
+ .sr_goButton {
77
+ float: right;
78
+ vertical-align: middle;
79
+ }
80
+
81
+ </style>
82
+
83
+ <META NAME="ITMS Link Maker" CONTENT="WebObjects 5.2">
84
+ <TITLE>ITMS Link Maker</TITLE>
85
+ </HEAD>
86
+
87
+ <BODY BGCOLOR="#FFFFFF">
88
+ <TABLE HEIGHT="100%" WIDTH="100%">
89
+ <TR><TD ALIGN=CENTER VALIGN=TOP>
90
+ <br/><br/>
91
+ <form name="itmsLinkForm" method="get" action="/WebObjects/MZStoreServices.woa/wa/itmsSearch">
92
+
93
+
94
+ <input type=hidden value="ISO8859_1" name="WOURLEncoding">
95
+ <input type=hidden value="1" name="lang">
96
+ <input type="hidden" value="lm" name="output"/>
97
+
98
+
99
+
100
+
101
+ <TABLE WIDTH="448" BORDER="0" BORDERCOLOR="#CCCCCC" CELLSPACING="0" CELLPADDING="0">
102
+
103
+ <TR HEIGHT="36">
104
+ <TD ALIGN="center" WIDTH="721" HEIGHT="36"><img width="721" height="60" alt="" border="0" src="/images/linkmaker/linkmaker.gif"></TD>
105
+ </TR>
106
+ <TR HEIGHT="50">
107
+ <TD ALIGN="center" VALIGN="middle" WIDTH="721" HEIGHT="50" BACKGROUND="/images/linkmaker/bg_gray.gif">
108
+ <TABLE CELLSPACING=2 BORDER=0 CELLPADDING=2>
109
+
110
+ <TR><TD width="5%"/><TD width="90%"><BR>Welcome to iTunes Link Maker. This simple web interface will automatically generate html you can copy-and-paste into your own code to create deep links to any music on the iTunes Store. &nbsp;Simply enter a song name, album name, artist name, or any combination of the three to get started:</TD><TD width="5%"/></TR>
111
+
112
+ </TABLE><BR>
113
+
114
+ <TABLE WIDTH="608" BORDER="0" CELLSPACING="0" CELLPADDING="2">
115
+ <TR>
116
+ <TD VALIGN="bottom">
117
+ <FONT SIZE="2" FACE="Helvetica,Arial,Geneva,Swiss,SunSans-Regular"><B>
118
+ Country
119
+ </B></FONT>
120
+ </TD>
121
+ <TD VALIGN="bottom">
122
+ <FONT SIZE="2" FACE="Helvetica,Arial,Geneva,Swiss,SunSans-Regular"><B>
123
+
124
+ Search
125
+ </B></FONT>
126
+ </TD>
127
+ <TD VALIGN="bottom">
128
+ <FONT SIZE="2" FACE="Helvetica,Arial,Geneva,Swiss,SunSans-Regular"><B>
129
+ Media Type
130
+ </B></FONT>
131
+ </TD>
132
+ <TD></TD>
133
+ </TR>
134
+
135
+ <TR>
136
+ <TD VALIGN="top"><select name="country">
137
+ <option value="AU">Australia</option>
138
+ <option value="AT">Austria</option>
139
+ <option value="BE">Belgium</option>
140
+ <option value="CA">Canada</option>
141
+ <option value="DK">Denmark</option>
142
+ <option value="FI">Finland</option>
143
+ <option value="FR">France</option>
144
+
145
+ <option value="DE">Germany</option>
146
+ <option value="GR">Greece</option>
147
+ <option value="IE">Ireland</option>
148
+ <option value="IT">Italy</option>
149
+ <option value="JP">Japan</option>
150
+ <option value="LU">Luxembourg</option>
151
+ <option value="NL">Netherlands</option>
152
+ <option value="NZ">New Zealand</option>
153
+ <option value="NO">Norway</option>
154
+
155
+ <option value="PT">Portugal</option>
156
+ <option value="ES">Spain</option>
157
+ <option value="SE">Sweden</option>
158
+ <option value="CH">Switzerland</option>
159
+ <option value="GB">UK</option>
160
+ <option selected value="US">USA</option></select>&nbsp;&nbsp;&nbsp;</TD>
161
+ <TD VALIGN="top"><input size="22" type=text value="postal service such great heights" name="term">&nbsp;&nbsp;&nbsp;</TD>
162
+ <TD VALIGN="top"><select name="media">
163
+ <option value="all">All Results</option>
164
+
165
+ <option selected value="music">Music</option>
166
+ <option value="movie">Movies</option>
167
+ <option value="shortFilm">Short Films</option>
168
+ <option value="tvShow">TV Shows</option>
169
+ <option value="musicVideo">Music Videos</option>
170
+ <option value="audiobook">Audiobooks</option>
171
+ <option value="podcast">Podcasts</option>
172
+ <option value="iTunesU">iTunes U</option></select>&nbsp;&nbsp;&nbsp;</TD>
173
+ <TD VALIGN="top"><span onClick="itmsLinkForm.submit();"><img src="/images/linkmaker/btn_search.gif"><span></TD>
174
+
175
+ </TR>
176
+
177
+ <TR height="90"><TD>&nbsp;</TD></TR>
178
+
179
+ </TABLE>
180
+
181
+
182
+ <TABLE CELLSPACING=2 BORDER=0 CELLPADDING=2>
183
+ <TR>
184
+ <TD>
185
+ <font color="#bbbbbb">Step 1: Enter the song, album, and/or artist to which you wish to link. Click &quot;Search&quot;.</font><BR>
186
+
187
+
188
+ Step 2: Click the drill down arrow
189
+ <IMG SRC="/images/linkmaker/arrow_999999_r.gif" BORDER=0 WIDTH=12 ALT="" HEIGHT=12/>
190
+ associated with a specific link on the page.
191
+ <BR>
192
+ <font color="#bbbbbb">Step 3: Copy and paste the HTML link into your web page.</font>
193
+ </TD>
194
+ </TR>
195
+ </TABLE>
196
+
197
+ <br/><br/>
198
+
199
+ </TD>
200
+ </TR>
201
+
202
+
203
+
204
+ <TR HEIGHT="13">
205
+ <TD ALIGN="center" VALIGN="top" WIDTH="721" HEIGHT="13">
206
+ <TABLE WIDTH="721" BORDER="0" CELLSPACING="0" CELLPADDING="0" HEIGHT="13">
207
+ <TR>
208
+ <TD><img width="247" height="13" alt="" border="0" src="/images/linkmaker/name.gif"></TD>
209
+ <TD><img width="246" height="13" alt="" border="0" src="/images/linkmaker/album.gif"></TD>
210
+
211
+ <TD><img width="228" height="13" alt="" border="0" src="/images/linkmaker/artist.gif"></TD>
212
+ </TR>
213
+ </TABLE>
214
+ </TD>
215
+ </TR>
216
+ <TR>
217
+ <TD ALIGN="center" VALIGN="top" WIDTH="721">
218
+ <TABLE CELLSPACING=1 CELLPADDING=0 BORDER=0 WIDTH=721 BACKGROUND="/images/linkmaker/bg_gray.gif"><tr><td>
219
+ <TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 WIDTH="100%">
220
+
221
+ <tr height="20" bgColor="#ffffff">
222
+
223
+ <TD class="searchResults" WIDTH="233" HEIGHT="20"><FONT SIZE="1" FACE="Helvetica,Arial,Geneva,Swiss,SunSans-Regular">
224
+ <div class="searchResults"><a class="searchResults" href="/WebObjects/MZStoreServices.woa/wa/itmsSearchDisplayUrl?desc=The+Postal+Service+-+Give+Up+-+Such+Great+Heights&amp;WOURLEncoding=ISO8859_1&amp;lang=1&amp;url=http%3A%2F%2Fphobos.apple.com%2FWebObjects%2FMZStore.woa%2Fwa%2FviewAlbum%3Fi%3D2522315%26id%3D2522333%26s%3D143441">
225
+ <div class="sr_goButton">
226
+
227
+ <IMG SRC="/images/linkmaker/arrow_999999_r.gif" ALT="" WIDTH="12" HEIGHT="12" BORDER="0"/>
228
+ </div>
229
+ <span class="searchResults">Such Great Heights</span>
230
+
231
+ </a></div>
232
+ </FONT></TD>
233
+
234
+ <TD class="searchResults" WIDTH="232" HEIGHT="20"><FONT SIZE="1" FACE="Helvetica,Arial,Geneva,Swiss,SunSans-Regular">
235
+ <div class="searchResults"><a class="searchResults" href="/WebObjects/MZStoreServices.woa/wa/itmsSearchDisplayUrl?desc=The+Postal+Service+-+Give+Up&amp;WOURLEncoding=ISO8859_1&amp;lang=1&amp;url=http%3A%2F%2Fphobos.apple.com%2FWebObjects%2FMZStore.woa%2Fwa%2FviewAlbum%3Fi%3D2522315%26id%3D2522333%26s%3D143441">
236
+ <div class="sr_goButton">
237
+ <IMG SRC="/images/linkmaker/arrow_999999_r.gif" ALT="" WIDTH="12" HEIGHT="12" BORDER="0"/>
238
+ </div>
239
+ <span class="searchResults">Give Up</span>
240
+
241
+ </a></div>
242
+ </FONT></TD>
243
+
244
+ <TD class="searchResults" WIDTH="211" HEIGHT="20"><FONT SIZE="1" FACE="Helvetica,Arial,Geneva,Swiss,SunSans-Regular">
245
+ <div class="searchResults">
246
+ <a class="searchResults" href="/WebObjects/MZStoreServices.woa/wa/itmsSearchDisplayUrl?desc=The+Postal+Service&amp;WOURLEncoding=ISO8859_1&amp;lang=1&amp;url=http%3A%2F%2Fphobos.apple.com%2FWebObjects%2FMZStore.woa%2Fwa%2FviewArtist%3Fid%3D2522312">
247
+ <div class="sr_goButton">
248
+ <IMG SRC="/images/linkmaker/arrow_999999_r.gif" ALT="" WIDTH="12" HEIGHT="12" BORDER="0"/>
249
+ </div>
250
+
251
+ <span class="searchResults">The Postal Service</span>
252
+ </a>
253
+
254
+
255
+ </div>
256
+ </FONT></TD>
257
+
258
+ </tr><tr height="20" bgColor="#edf3fe">
259
+
260
+ <TD class="searchResults" WIDTH="233" HEIGHT="20"><FONT SIZE="1" FACE="Helvetica,Arial,Geneva,Swiss,SunSans-Regular">
261
+ <div class="searchResults"><a class="searchResults" href="/WebObjects/MZStoreServices.woa/wa/itmsSearchDisplayUrl?desc=Postal+Service+-+Grey%27s+Anatomy+-+Such+Great+Heights&amp;WOURLEncoding=ISO8859_1&amp;lang=1&amp;url=http%3A%2F%2Fphobos.apple.com%2FWebObjects%2FMZStore.woa%2Fwa%2FviewAlbum%3Fi%3D80567414%26id%3D80567412%26s%3D143441">
262
+
263
+ <div class="sr_goButton">
264
+
265
+ <IMG SRC="/images/linkmaker/arrow_999999_r.gif" ALT="" WIDTH="12" HEIGHT="12" BORDER="0"/>
266
+ </div>
267
+ <span class="searchResults">Such Great Heights</span>
268
+ </a></div>
269
+ </FONT></TD>
270
+
271
+ <TD class="searchResults" WIDTH="232" HEIGHT="20"><FONT SIZE="1" FACE="Helvetica,Arial,Geneva,Swiss,SunSans-Regular">
272
+ <div class="searchResults"><a class="searchResults" href="/WebObjects/MZStoreServices.woa/wa/itmsSearchDisplayUrl?desc=Postal+Service+-+Grey%27s+Anatomy&amp;WOURLEncoding=ISO8859_1&amp;lang=1&amp;url=http%3A%2F%2Fphobos.apple.com%2FWebObjects%2FMZStore.woa%2Fwa%2FviewAlbum%3Fi%3D80567414%26id%3D80567412%26s%3D143441">
273
+
274
+ <div class="sr_goButton">
275
+ <IMG SRC="/images/linkmaker/arrow_999999_r.gif" ALT="" WIDTH="12" HEIGHT="12" BORDER="0"/>
276
+ </div>
277
+ <span class="searchResults">Grey's Anatomy</span>
278
+ </a></div>
279
+ </FONT></TD>
280
+
281
+ <TD class="searchResults" WIDTH="211" HEIGHT="20"><FONT SIZE="1" FACE="Helvetica,Arial,Geneva,Swiss,SunSans-Regular">
282
+ <div class="searchResults">
283
+
284
+ <a class="searchResults" href="/WebObjects/MZStoreServices.woa/wa/itmsSearchDisplayUrl?desc=Postal+Service&amp;WOURLEncoding=ISO8859_1&amp;lang=1&amp;url=http%3A%2F%2Fphobos.apple.com%2FWebObjects%2FMZStore.woa%2Fwa%2FviewArtist%3Fid%3D54068405">
285
+ <div class="sr_goButton">
286
+ <IMG SRC="/images/linkmaker/arrow_999999_r.gif" ALT="" WIDTH="12" HEIGHT="12" BORDER="0"/>
287
+ </div>
288
+ <span class="searchResults">Postal Service</span>
289
+ </a>
290
+
291
+
292
+ </div>
293
+ </FONT></TD>
294
+
295
+ </tr><tr height="20" bgColor="#ffffff">
296
+
297
+ <TD class="searchResults" WIDTH="233" HEIGHT="20"><FONT SIZE="1" FACE="Helvetica,Arial,Geneva,Swiss,SunSans-Regular">
298
+ <div class="searchResults"><a class="searchResults" href="/WebObjects/MZStoreServices.woa/wa/itmsSearchDisplayUrl?desc=The+Postal+Service+-+Give+Up+-+Such+Great+Heights&amp;WOURLEncoding=ISO8859_1&amp;lang=1&amp;url=http%3A%2F%2Fphobos.apple.com%2FWebObjects%2FMZStore.woa%2Fwa%2FviewVideo%3Fid%3D118712451%26s%3D143441">
299
+ <div class="sr_goButton">
300
+ [V]
301
+ <IMG SRC="/images/linkmaker/arrow_999999_r.gif" ALT="" WIDTH="12" HEIGHT="12" BORDER="0"/>
302
+ </div>
303
+ <span class="searchResults">Such Great Heights</span>
304
+
305
+ </a></div>
306
+ </FONT></TD>
307
+
308
+ <TD class="searchResults" WIDTH="232" HEIGHT="20"><FONT SIZE="1" FACE="Helvetica,Arial,Geneva,Swiss,SunSans-Regular">
309
+ <div class="searchResults"><a class="searchResults" href="/WebObjects/MZStoreServices.woa/wa/itmsSearchDisplayUrl?desc=The+Postal+Service+-+Give+Up&amp;WOURLEncoding=ISO8859_1&amp;lang=1&amp;url=http%3A%2F%2Fphobos.apple.com%2FWebObjects%2FMZStore.woa%2Fwa%2FviewVideo%3Fid%3D118712451%26s%3D143441">
310
+ <div class="sr_goButton">
311
+ <IMG SRC="/images/linkmaker/arrow_999999_r.gif" ALT="" WIDTH="12" HEIGHT="12" BORDER="0"/>
312
+ </div>
313
+ <span class="searchResults">Give Up</span>
314
+
315
+ </a></div>
316
+ </FONT></TD>
317
+
318
+ <TD class="searchResults" WIDTH="211" HEIGHT="20"><FONT SIZE="1" FACE="Helvetica,Arial,Geneva,Swiss,SunSans-Regular">
319
+ <div class="searchResults">
320
+ <a class="searchResults" href="/WebObjects/MZStoreServices.woa/wa/itmsSearchDisplayUrl?desc=The+Postal+Service&amp;WOURLEncoding=ISO8859_1&amp;lang=1&amp;url=http%3A%2F%2Fphobos.apple.com%2FWebObjects%2FMZStore.woa%2Fwa%2FviewArtist%3Fid%3D2522312">
321
+ <div class="sr_goButton">
322
+ <IMG SRC="/images/linkmaker/arrow_999999_r.gif" ALT="" WIDTH="12" HEIGHT="12" BORDER="0"/>
323
+ </div>
324
+
325
+ <span class="searchResults">The Postal Service</span>
326
+ </a>
327
+
328
+
329
+ </div>
330
+ </FONT></TD>
331
+
332
+ </tr><tr height="20" bgColor="#edf3fe">
333
+
334
+ <TD class="searchResults" WIDTH="233" HEIGHT="20"><FONT SIZE="1" FACE="Helvetica,Arial,Geneva,Swiss,SunSans-Regular">
335
+ <div class="searchResults"><a class="searchResults" href="/WebObjects/MZStoreServices.woa/wa/itmsSearchDisplayUrl?desc=The+Postal+Service+-+Such+Great+Heights+-+EP+-+Such+Great+Heights&amp;WOURLEncoding=ISO8859_1&amp;lang=1&amp;url=http%3A%2F%2Fphobos.apple.com%2FWebObjects%2FMZStore.woa%2Fwa%2FviewAlbum%3Fi%3D20922894%26id%3D20922902%26s%3D143441">
336
+
337
+ <div class="sr_goButton">
338
+
339
+ <IMG SRC="/images/linkmaker/arrow_999999_r.gif" ALT="" WIDTH="12" HEIGHT="12" BORDER="0"/>
340
+ </div>
341
+ <span class="searchResults">Such Great Heights</span>
342
+ </a></div>
343
+ </FONT></TD>
344
+
345
+ <TD class="searchResults" WIDTH="232" HEIGHT="20"><FONT SIZE="1" FACE="Helvetica,Arial,Geneva,Swiss,SunSans-Regular">
346
+ <div class="searchResults"><a class="searchResults" href="/WebObjects/MZStoreServices.woa/wa/itmsSearchDisplayUrl?desc=The+Postal+Service+-+Such+Great+Heights+-+EP&amp;WOURLEncoding=ISO8859_1&amp;lang=1&amp;url=http%3A%2F%2Fphobos.apple.com%2FWebObjects%2FMZStore.woa%2Fwa%2FviewAlbum%3Fi%3D20922894%26id%3D20922902%26s%3D143441">
347
+
348
+ <div class="sr_goButton">
349
+ <IMG SRC="/images/linkmaker/arrow_999999_r.gif" ALT="" WIDTH="12" HEIGHT="12" BORDER="0"/>
350
+ </div>
351
+ <span class="searchResults">Such Great Heights - EP</span>
352
+ </a></div>
353
+ </FONT></TD>
354
+
355
+ <TD class="searchResults" WIDTH="211" HEIGHT="20"><FONT SIZE="1" FACE="Helvetica,Arial,Geneva,Swiss,SunSans-Regular">
356
+ <div class="searchResults">
357
+
358
+ <a class="searchResults" href="/WebObjects/MZStoreServices.woa/wa/itmsSearchDisplayUrl?desc=The+Postal+Service&amp;WOURLEncoding=ISO8859_1&amp;lang=1&amp;url=http%3A%2F%2Fphobos.apple.com%2FWebObjects%2FMZStore.woa%2Fwa%2FviewArtist%3Fid%3D2522312">
359
+ <div class="sr_goButton">
360
+ <IMG SRC="/images/linkmaker/arrow_999999_r.gif" ALT="" WIDTH="12" HEIGHT="12" BORDER="0"/>
361
+ </div>
362
+ <span class="searchResults">The Postal Service</span>
363
+ </a>
364
+
365
+
366
+ </div>
367
+ </FONT></TD>
368
+
369
+ </tr><tr height="20" bgColor="#ffffff">
370
+
371
+ <TD class="searchResults" WIDTH="233" HEIGHT="20"><FONT SIZE="1" FACE="Helvetica,Arial,Geneva,Swiss,SunSans-Regular">
372
+ <div class="searchResults"><a class="searchResults" href="/WebObjects/MZStoreServices.woa/wa/itmsSearchDisplayUrl?desc=The+Postal+Service+-+Such+Great+Heights+-+EP+-+There%27s+Never+Enough+Time&amp;WOURLEncoding=ISO8859_1&amp;lang=1&amp;url=http%3A%2F%2Fphobos.apple.com%2FWebObjects%2FMZStore.woa%2Fwa%2FviewAlbum%3Fi%3D20922896%26id%3D20922902%26s%3D143441">
373
+ <div class="sr_goButton">
374
+
375
+ <IMG SRC="/images/linkmaker/arrow_999999_r.gif" ALT="" WIDTH="12" HEIGHT="12" BORDER="0"/>
376
+ </div>
377
+ <span class="searchResults">There's Never Enough Time</span>
378
+
379
+ </a></div>
380
+ </FONT></TD>
381
+
382
+ <TD class="searchResults" WIDTH="232" HEIGHT="20"><FONT SIZE="1" FACE="Helvetica,Arial,Geneva,Swiss,SunSans-Regular">
383
+ <div class="searchResults"><a class="searchResults" href="/WebObjects/MZStoreServices.woa/wa/itmsSearchDisplayUrl?desc=The+Postal+Service+-+Such+Great+Heights+-+EP&amp;WOURLEncoding=ISO8859_1&amp;lang=1&amp;url=http%3A%2F%2Fphobos.apple.com%2FWebObjects%2FMZStore.woa%2Fwa%2FviewAlbum%3Fi%3D20922896%26id%3D20922902%26s%3D143441">
384
+ <div class="sr_goButton">
385
+ <IMG SRC="/images/linkmaker/arrow_999999_r.gif" ALT="" WIDTH="12" HEIGHT="12" BORDER="0"/>
386
+ </div>
387
+ <span class="searchResults">Such Great Heights - EP</span>
388
+
389
+ </a></div>
390
+ </FONT></TD>
391
+
392
+ <TD class="searchResults" WIDTH="211" HEIGHT="20"><FONT SIZE="1" FACE="Helvetica,Arial,Geneva,Swiss,SunSans-Regular">
393
+ <div class="searchResults">
394
+ <a class="searchResults" href="/WebObjects/MZStoreServices.woa/wa/itmsSearchDisplayUrl?desc=The+Postal+Service&amp;WOURLEncoding=ISO8859_1&amp;lang=1&amp;url=http%3A%2F%2Fphobos.apple.com%2FWebObjects%2FMZStore.woa%2Fwa%2FviewArtist%3Fid%3D2522312">
395
+ <div class="sr_goButton">
396
+ <IMG SRC="/images/linkmaker/arrow_999999_r.gif" ALT="" WIDTH="12" HEIGHT="12" BORDER="0"/>
397
+ </div>
398
+
399
+ <span class="searchResults">The Postal Service</span>
400
+ </a>
401
+
402
+
403
+ </div>
404
+ </FONT></TD>
405
+
406
+ </tr><tr height="20" bgColor="#edf3fe">
407
+
408
+ <TD class="searchResults" WIDTH="233" HEIGHT="20"><FONT SIZE="1" FACE="Helvetica,Arial,Geneva,Swiss,SunSans-Regular">
409
+ <div class="searchResults"><a class="searchResults" href="/WebObjects/MZStoreServices.woa/wa/itmsSearchDisplayUrl?desc=The+Postal+Service+-+The+District+Sleeps+Alone+Tonight+-+EP+-+Such+Great+Heights&amp;WOURLEncoding=ISO8859_1&amp;lang=1&amp;url=http%3A%2F%2Fphobos.apple.com%2FWebObjects%2FMZStore.woa%2Fwa%2FviewAlbum%3Fi%3D20919979%26id%3D20920002%26s%3D143441">
410
+
411
+ <div class="sr_goButton">
412
+
413
+ <IMG SRC="/images/linkmaker/arrow_999999_r.gif" ALT="" WIDTH="12" HEIGHT="12" BORDER="0"/>
414
+ </div>
415
+ <span class="searchResults">Such Great Heights</span>
416
+ </a></div>
417
+ </FONT></TD>
418
+
419
+ <TD class="searchResults" WIDTH="232" HEIGHT="20"><FONT SIZE="1" FACE="Helvetica,Arial,Geneva,Swiss,SunSans-Regular">
420
+ <div class="searchResults"><a class="searchResults" href="/WebObjects/MZStoreServices.woa/wa/itmsSearchDisplayUrl?desc=The+Postal+Service+-+The+District+Sleeps+Alone+Tonight+-+EP&amp;WOURLEncoding=ISO8859_1&amp;lang=1&amp;url=http%3A%2F%2Fphobos.apple.com%2FWebObjects%2FMZStore.woa%2Fwa%2FviewAlbum%3Fi%3D20919979%26id%3D20920002%26s%3D143441">
421
+
422
+ <div class="sr_goButton">
423
+ <IMG SRC="/images/linkmaker/arrow_999999_r.gif" ALT="" WIDTH="12" HEIGHT="12" BORDER="0"/>
424
+ </div>
425
+ <span class="searchResults">The District Sleeps Alone Tonight - EP</span>
426
+ </a></div>
427
+ </FONT></TD>
428
+
429
+ <TD class="searchResults" WIDTH="211" HEIGHT="20"><FONT SIZE="1" FACE="Helvetica,Arial,Geneva,Swiss,SunSans-Regular">
430
+ <div class="searchResults">
431
+
432
+ <a class="searchResults" href="/WebObjects/MZStoreServices.woa/wa/itmsSearchDisplayUrl?desc=The+Postal+Service&amp;WOURLEncoding=ISO8859_1&amp;lang=1&amp;url=http%3A%2F%2Fphobos.apple.com%2FWebObjects%2FMZStore.woa%2Fwa%2FviewArtist%3Fid%3D2522312">
433
+ <div class="sr_goButton">
434
+ <IMG SRC="/images/linkmaker/arrow_999999_r.gif" ALT="" WIDTH="12" HEIGHT="12" BORDER="0"/>
435
+ </div>
436
+ <span class="searchResults">The Postal Service</span>
437
+ </a>
438
+
439
+
440
+ </div>
441
+ </FONT></TD>
442
+
443
+ </tr>
444
+
445
+ <TR HEIGHT="20"/>
446
+
447
+ </TABLE></td></tr></table>
448
+ </TD>
449
+ </TR>
450
+
451
+
452
+
453
+ <TR HEIGHT="28">
454
+ <TD ALIGN="center" VALIGN="middle" WIDTH="721" HEIGHT="28" BACKGROUND="/images/linkmaker/box_bottom.gif">
455
+
456
+
457
+
458
+ <TABLE WIDTH="180" BORDER="0" CELLSPACING="0" CELLPADDING="2"><TR>
459
+ <TD></TD>
460
+ <TD ALIGN="center"><FONT SIZE="1" FACE="Helvetica,Arial,Geneva,Swiss,SunSans-Regular"><B>
461
+ 6&nbsp;Hits
462
+ </B></FONT></TD>
463
+ <TD></TD>
464
+ </TR></TABLE>
465
+
466
+
467
+ </TD>
468
+
469
+ </TR>
470
+ </TABLE>
471
+
472
+
473
+
474
+
475
+ </form>
476
+ <P></P>
477
+ </TD></TR>
478
+ <TR><TD ALIGN=CENTER>
479
+ The iTunes Link Maker is provided by Apple as an accommodation only.<br>Apple assumes no responsibility for your use of any links, and makes no representation regarding their accuracy or performance. <br>Nothing shall be construed as permission or a grant by Apple in relation to the use of any artist, track or album name,<br> and you agree that any use by you, or result from your use, shall be solely your responsibility.<br>Apple reserves the right to de-activate links at its sole discretion.
480
+ <br/><br/>
481
+
482
+
483
+ <!-- <a href="MHITMSLinkGeneratorWrapper.FaqUrl">FAQ</a> | -->
484
+ <a href="mailto:musicstore@apple.com">Contact Us</a>
485
+ <BR>Copyright &copy; 2008 Apple Inc. All rights reserved.</td></tr>
486
+ <img width="1" height="1" src="http://metrics.apple.com/b/ss/applesuperglobal/1/G.6--NS?pageName=Generator-US-term%3Apostal+service+such+great+heights&pccr=true&h5=appleitmsna%2Cappleitmsus&g=http%3A%2F%2Fax.phobos.apple.com.edgesuite.net%2FWebObjects%2FMZStoreServices.woa%2Fwa%2FitmsSearch%3FWOURLEncoding%3DISO8859_1%26lang%3D1%26output%3Dlm%26country%3DUS%26term%3Dpostal%2Bservice%2Bsuch%2Bgreat%2Bheights%26media%3Dmusic">
487
+
488
+ </BODY>
489
+ </HTML>
490
+
@@ -0,0 +1,268 @@
1
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
2
+ <HTML>
3
+ <HEAD>
4
+ <meta http-equiv="content-type" content="text/html; charset=utf-8">
5
+ <STYLE TYPE="text/css">
6
+
7
+ A {
8
+ text-decoration: none;
9
+ }
10
+
11
+ A:link {
12
+ color: #3366cc;
13
+ text-decoration: none;
14
+ }
15
+
16
+ A:visited {
17
+ color: #663399;
18
+ text-decoration: none;
19
+ }
20
+
21
+ A:active {
22
+ color: #cccccc;
23
+ text-decoration: none;
24
+ }
25
+
26
+ A:Hover {
27
+ text-decoration: underline;
28
+ }
29
+
30
+ BODY, TD, CENTER, P {
31
+ font-family: Geneva, Verdana, Arial, Helvetica;
32
+ font-size: 10px;
33
+ color: #333333;
34
+ }
35
+
36
+ .body {
37
+ font-family: Geneva, Verdana, Arial, Helvetica;
38
+ font-size: 10px;
39
+ color: #333333;
40
+ }
41
+
42
+ .content {
43
+ font-family: Arial, Helvetica, sans-serif;
44
+ font-size: 11px;
45
+ font-weight: normal;
46
+ color: #000000;
47
+ }
48
+
49
+ .title {
50
+ font-family: Helvetica, Arial, sans-serif;
51
+ font-size: 10px;
52
+ font-weight: normal;
53
+ color: #000000;
54
+ }
55
+
56
+ td.searchResults {
57
+ border-style: solid;
58
+ border-right-width: 1px;
59
+ border-color: #cccccc;
60
+ }
61
+
62
+ div.searchResults {
63
+ margin: 0px 5px 0px 5px;
64
+ color: black;
65
+ }
66
+
67
+ .searchResults a {
68
+ color: black;
69
+ text-decoration: none;
70
+ }
71
+
72
+ .sr_goButton img {
73
+ vertical-align: middle;
74
+ }
75
+
76
+ .sr_goButton {
77
+ float: right;
78
+ vertical-align: middle;
79
+ }
80
+
81
+ </style>
82
+
83
+ <META NAME="ITMS Link Maker" CONTENT="WebObjects 5.2">
84
+ <TITLE>ITMS Link Maker</TITLE>
85
+ </HEAD>
86
+
87
+ <BODY BGCOLOR="#FFFFFF">
88
+ <TABLE HEIGHT="100%" WIDTH="100%">
89
+ <TR><TD ALIGN=CENTER VALIGN=TOP>
90
+ <br/><br/>
91
+ <form name="itmsLinkForm" method="get" action="/WebObjects/MZStoreServices.woa/wa/itmsSearch">
92
+
93
+
94
+ <input type=hidden value="ISO8859_1" name="WOURLEncoding">
95
+ <input type=hidden value="1" name="lang">
96
+ <input type="hidden" value="lm" name="output"/>
97
+
98
+
99
+
100
+
101
+ <TABLE WIDTH="448" BORDER="0" BORDERCOLOR="#CCCCCC" CELLSPACING="0" CELLPADDING="0">
102
+
103
+ <TR HEIGHT="36">
104
+ <TD ALIGN="center" WIDTH="721" HEIGHT="36"><img width="721" height="60" alt="" border="0" src="/images/linkmaker/linkmaker.gif"></TD>
105
+ </TR>
106
+ <TR HEIGHT="50">
107
+ <TD ALIGN="center" VALIGN="middle" WIDTH="721" HEIGHT="50" BACKGROUND="/images/linkmaker/bg_gray.gif">
108
+ <TABLE CELLSPACING=2 BORDER=0 CELLPADDING=2>
109
+
110
+ <TR><TD width="5%"/><TD width="90%"><BR>Welcome to iTunes Link Maker. This simple web interface will automatically generate html you can copy-and-paste into your own code to create deep links to any music on the iTunes Store. &nbsp;Simply enter a song name, album name, artist name, or any combination of the three to get started:</TD><TD width="5%"/></TR>
111
+
112
+ </TABLE><BR>
113
+
114
+ <TABLE WIDTH="608" BORDER="0" CELLSPACING="0" CELLPADDING="2">
115
+ <TR>
116
+ <TD VALIGN="bottom">
117
+ <FONT SIZE="2" FACE="Helvetica,Arial,Geneva,Swiss,SunSans-Regular"><B>
118
+ Country
119
+ </B></FONT>
120
+ </TD>
121
+ <TD VALIGN="bottom">
122
+ <FONT SIZE="2" FACE="Helvetica,Arial,Geneva,Swiss,SunSans-Regular"><B>
123
+
124
+ Search
125
+ </B></FONT>
126
+ </TD>
127
+ <TD VALIGN="bottom">
128
+ <FONT SIZE="2" FACE="Helvetica,Arial,Geneva,Swiss,SunSans-Regular"><B>
129
+ Media Type
130
+ </B></FONT>
131
+ </TD>
132
+ <TD></TD>
133
+ </TR>
134
+
135
+ <TR>
136
+ <TD VALIGN="top"><select name="country">
137
+ <option value="AU">Australia</option>
138
+ <option value="AT">Austria</option>
139
+ <option value="BE">Belgium</option>
140
+ <option value="CA">Canada</option>
141
+ <option value="DK">Denmark</option>
142
+ <option value="FI">Finland</option>
143
+ <option value="FR">France</option>
144
+
145
+ <option value="DE">Germany</option>
146
+ <option value="GR">Greece</option>
147
+ <option value="IE">Ireland</option>
148
+ <option value="IT">Italy</option>
149
+ <option value="JP">Japan</option>
150
+ <option value="LU">Luxembourg</option>
151
+ <option value="NL">Netherlands</option>
152
+ <option value="NZ">New Zealand</option>
153
+ <option value="NO">Norway</option>
154
+
155
+ <option value="PT">Portugal</option>
156
+ <option value="ES">Spain</option>
157
+ <option value="SE">Sweden</option>
158
+ <option value="CH">Switzerland</option>
159
+ <option value="GB">UK</option>
160
+ <option selected value="US">USA</option></select>&nbsp;&nbsp;&nbsp;</TD>
161
+ <TD VALIGN="top"><input size="22" type=text value="kafoozl" name="term">&nbsp;&nbsp;&nbsp;</TD>
162
+ <TD VALIGN="top"><select name="media">
163
+ <option value="all">All Results</option>
164
+
165
+ <option selected value="music">Music</option>
166
+ <option value="movie">Movies</option>
167
+ <option value="shortFilm">Short Films</option>
168
+ <option value="tvShow">TV Shows</option>
169
+ <option value="musicVideo">Music Videos</option>
170
+ <option value="audiobook">Audiobooks</option>
171
+ <option value="podcast">Podcasts</option>
172
+ <option value="iTunesU">iTunes U</option></select>&nbsp;&nbsp;&nbsp;</TD>
173
+ <TD VALIGN="top"><span onClick="itmsLinkForm.submit();"><img src="/images/linkmaker/btn_search.gif"><span></TD>
174
+
175
+ </TR>
176
+
177
+ <TR height="90"><TD>&nbsp;</TD></TR>
178
+
179
+ </TABLE>
180
+
181
+
182
+ <TABLE CELLSPACING=2 BORDER=0 CELLPADDING=2>
183
+ <TR>
184
+ <TD>
185
+ <font color="#bbbbbb">Step 1: Enter the song, album, and/or artist to which you wish to link. Click &quot;Search&quot;.</font><BR>
186
+
187
+ <font color="#bbbbbb">
188
+ Step 2: Click the drill down arrow
189
+ <IMG SRC="/images/linkmaker/arrow_999999_r.gif" BORDER=0 WIDTH=12 ALT="" HEIGHT=12/>
190
+ associated with a specific link on the page.
191
+ </font><BR>
192
+ <font color="#bbbbbb">Step 3: Copy and paste the HTML link into your web page.</font>
193
+ </TD>
194
+ </TR>
195
+ </TABLE>
196
+
197
+ <br/><br/>
198
+ </TD>
199
+ </TR>
200
+
201
+
202
+
203
+ <TR HEIGHT="13">
204
+ <TD ALIGN="center" VALIGN="top" WIDTH="721" HEIGHT="13">
205
+ <TABLE WIDTH="721" BORDER="0" CELLSPACING="0" CELLPADDING="0" HEIGHT="13">
206
+ <TR>
207
+ <TD><img width="247" height="13" alt="" border="0" src="/images/linkmaker/name.gif"></TD>
208
+
209
+ <TD><img width="246" height="13" alt="" border="0" src="/images/linkmaker/album.gif"></TD>
210
+ <TD><img width="228" height="13" alt="" border="0" src="/images/linkmaker/artist.gif"></TD>
211
+ </TR>
212
+ </TABLE>
213
+ </TD>
214
+ </TR>
215
+ <TR>
216
+ <TD ALIGN="center" VALIGN="top" WIDTH="721">
217
+ <TABLE CELLSPACING=1 CELLPADDING=0 BORDER=0 WIDTH=721 BACKGROUND="/images/linkmaker/bg_gray.gif"><tr><td>
218
+
219
+ <TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 WIDTH="100%">
220
+
221
+
222
+
223
+ <TR HEIGHT="20"/>
224
+
225
+ </TABLE></td></tr></table>
226
+ </TD>
227
+ </TR>
228
+
229
+
230
+
231
+ <TR HEIGHT="28">
232
+ <TD ALIGN="center" VALIGN="middle" WIDTH="721" HEIGHT="28" BACKGROUND="/images/linkmaker/box_bottom.gif">
233
+
234
+
235
+
236
+ <TABLE WIDTH="180" BORDER="0" CELLSPACING="0" CELLPADDING="2"><TR>
237
+ <TD></TD>
238
+ <TD ALIGN="center"><FONT SIZE="1" FACE="Helvetica,Arial,Geneva,Swiss,SunSans-Regular"><B>
239
+ 0&nbsp;Hits
240
+ </B></FONT></TD>
241
+ <TD></TD>
242
+ </TR></TABLE>
243
+
244
+
245
+ </TD>
246
+ </TR>
247
+
248
+ </TABLE>
249
+
250
+
251
+
252
+
253
+ </form>
254
+ <P></P>
255
+ </TD></TR>
256
+ <TR><TD ALIGN=CENTER>
257
+ The iTunes Link Maker is provided by Apple as an accommodation only.<br>Apple assumes no responsibility for your use of any links, and makes no representation regarding their accuracy or performance. <br>Nothing shall be construed as permission or a grant by Apple in relation to the use of any artist, track or album name,<br> and you agree that any use by you, or result from your use, shall be solely your responsibility.<br>Apple reserves the right to de-activate links at its sole discretion.
258
+ <br/><br/>
259
+
260
+
261
+ <!-- <a href="MHITMSLinkGeneratorWrapper.FaqUrl">FAQ</a> | -->
262
+ <a href="mailto:musicstore@apple.com">Contact Us</a>
263
+ <BR>Copyright &copy; 2008 Apple Inc. All rights reserved.</td></tr>
264
+ <img width="1" height="1" src="http://metrics.apple.com/b/ss/applesuperglobal/1/G.6--NS?pageName=Generator-US-term%3Akafoozl&pccr=true&h5=appleitmsna%2Cappleitmsus&g=http%3A%2F%2Fax.phobos.apple.com.edgesuite.net%2FWebObjects%2FMZStoreServices.woa%2Fwa%2FitmsSearch%3FWOURLEncoding%3DISO8859_1%26lang%3D1%26output%3Dlm%26country%3DUS%26term%3Dkafoozl%26media%3Dmusic">
265
+
266
+ </BODY>
267
+ </HTML>
268
+
@@ -0,0 +1,206 @@
1
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
2
+ <HTML>
3
+ <HEAD>
4
+ <meta http-equiv="content-type" content="text/html; charset=utf-8">
5
+ <STYLE TYPE="text/css">
6
+
7
+ A {
8
+ text-decoration: none;
9
+ }
10
+
11
+ A:link {
12
+ color: #3366cc;
13
+ text-decoration: none;
14
+ }
15
+
16
+ A:visited {
17
+ color: #663399;
18
+ text-decoration: none;
19
+ }
20
+
21
+ A:active {
22
+ color: #cccccc;
23
+ text-decoration: none;
24
+ }
25
+
26
+ A:Hover {
27
+ text-decoration: underline;
28
+ }
29
+
30
+ BODY, TD, CENTER, P {
31
+ font-family: Geneva, Verdana, Arial, Helvetica;
32
+ font-size: 10px;
33
+ color: #333333;
34
+ }
35
+
36
+ .body {
37
+ font-family: Geneva, Verdana, Arial, Helvetica;
38
+ font-size: 10px;
39
+ color: #333333;
40
+ }
41
+
42
+ .content {
43
+ font-family: Arial, Helvetica, sans-serif;
44
+ font-size: 11px;
45
+ font-weight: normal;
46
+ color: #000000;
47
+ }
48
+
49
+ .title {
50
+ font-family: Helvetica, Arial, sans-serif;
51
+ font-size: 10px;
52
+ font-weight: normal;
53
+ color: #000000;
54
+ }
55
+
56
+ td.searchResults {
57
+ border-style: solid;
58
+ border-right-width: 1px;
59
+ border-color: #cccccc;
60
+ }
61
+
62
+ div.searchResults {
63
+ margin: 0px 5px 0px 5px;
64
+ color: black;
65
+ }
66
+
67
+ .searchResults a {
68
+ color: black;
69
+ text-decoration: none;
70
+ }
71
+
72
+ .sr_goButton img {
73
+ vertical-align: middle;
74
+ }
75
+
76
+ .sr_goButton {
77
+ float: right;
78
+ vertical-align: middle;
79
+ }
80
+
81
+ </style>
82
+
83
+ <META NAME="ITMS Link Maker" CONTENT="WebObjects 5.2">
84
+ <TITLE>ITMS Link Maker</TITLE>
85
+ </HEAD>
86
+
87
+ <BODY BGCOLOR="#FFFFFF">
88
+ <TABLE HEIGHT="100%" WIDTH="100%">
89
+ <TR><TD ALIGN=CENTER VALIGN=TOP>
90
+
91
+ <BR>
92
+ <BR>
93
+ <TABLE WIDTH="448" BORDER="0" BORDERCOLOR="#CCCCCC" CELLSPACING="0" CELLPADDING="0">
94
+ <TR HEIGHT="36">
95
+ <TD ALIGN="center" WIDTH="721" HEIGHT="36">
96
+ <img width="721" height="60" alt="" border="0" src="/images/linkmaker/linkmaker.gif">
97
+
98
+ </TD>
99
+ </TR>
100
+
101
+
102
+
103
+
104
+ <TR HEIGHT="50">
105
+ <TD ALIGN="center" VALIGN="middle" WIDTH="721" HEIGHT="50" BACKGROUND="/images/linkmaker/bg_gray.gif"><br>
106
+ <TABLE CELLSPACING=2 BORDER=0 CELLPADDING=3>
107
+
108
+ <TR>
109
+
110
+ <TD align="right" VALIGN=TOP>
111
+ <FONT SIZE="1" FACE="Helvetica,Arial,Geneva,Swiss,SunSans-Regular">
112
+ Linking To:
113
+ </font>
114
+ </TD>
115
+ <TD VALIGN=TOP>
116
+ <FONT SIZE="1" FACE="Helvetica,Arial,Geneva,Swiss,SunSans-Regular">
117
+ The Postal Service - Give Up - Such Great Heights (USA)
118
+ </font><BR>
119
+ </TD>
120
+
121
+ </TR>
122
+ <tr>
123
+ <td align="right" valign=TOP>
124
+ <font size="1" face="Helvetica,Arial,Geneva,Swiss,SunSans-Regular">
125
+ Link Test:
126
+ </font>
127
+ </td>
128
+ <td valign=top>
129
+ <font size="1" face="Helvetica,Arial,Geneva,Swiss,SunSans-Regular">
130
+
131
+ <a href="http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewAlbum?i=2522315&id=2522333&s=143441">
132
+ <img border="0" width="61" height="15" src="http://ax.phobos.apple.com.edgesuite.net/images/badgeitunes61x15dark.gif">
133
+ </a>
134
+ </font>
135
+ </td>
136
+ </tr>
137
+ <tr>
138
+ <td align="right" valign=TOP>
139
+ <font size="1" face="Helvetica,Arial,Geneva,Swiss,SunSans-Regular">
140
+
141
+ Include this where you want<br>
142
+ the link to appear<br>
143
+ on your HTML&nbsp;page
144
+ </font>
145
+ </td>
146
+ <td valign=top>
147
+ <textarea rows="5" cols="67"><a href="http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewAlbum?i=2522315&id=2522333&s=143441"><img height="15" width="61" alt="The Postal Service - Give Up - Such Great Heights" src="http://ax.phobos.apple.com.edgesuite.net/images/badgeitunes61x15dark.gif" /></a></textarea>
148
+
149
+ </td></tr>
150
+ <tr><td colspan=2><center><br>
151
+ <TABLE cellpadding="3" cellspacing="2">
152
+ <TR><TD>
153
+ <FONT COLOR="#bbbbbb">Step 1: Enter the song, album, and/or artist to which you wish to link. Click &quot;Search&quot;.</font><BR>
154
+ <FONT COLOR="#bbbbbb">Step 2: Click the drill down arrow </font>
155
+ <img SRC="/images/linkmaker/arrow_999999_r.gif" BORDER=0 WIDTH=12 ALT="" HEIGHT=12/>
156
+
157
+ <FONT COLOR="#bbbbbb"> associated with a specific link on the page.</FONT><BR>
158
+ <FONT COLOR="#000000">Step 3: Copy and paste the HTML link into your web page.</FONT><BR>
159
+ </TD></TR>
160
+ </TABLE><BR>
161
+ </center></td></tr>
162
+
163
+
164
+
165
+
166
+ <TR><TD ALIGN=CENTER colspan=2>
167
+ <TABLE BORDER=0 WIDTH="75%">
168
+
169
+ <TR>
170
+ <TD>
171
+ The url in the text box on this page points directly to a deep link within the iTunes Store. When a user clicks on it, iTunes will open and navigate to the correct page. The iTunes graphic is included with the code and resides on Apple's servers; all you have to do is copy and paste. If iTunes is not present, the link will automatically take the user to an iTunes download page.
172
+ </TD>
173
+ </TR>
174
+ </TABLE>
175
+ </TD>
176
+
177
+ </TR>
178
+ </TABLE>
179
+ </TD>
180
+ </TR>
181
+
182
+ <TR HEIGHT="28">
183
+ <TD ALIGN="center" VALIGN="middle" WIDTH="721" HEIGHT="28" BACKGROUND="/images/linkmaker/box_bottom.gif">
184
+ <a href="javascript:history.go(-1);">
185
+ Back to Search Results
186
+ </a> | <a href="javascript:history.go(-2);">
187
+
188
+ New Search
189
+ </a>
190
+ </TD>
191
+ </TR>
192
+ </TABLE><P></P>
193
+
194
+ </TD></TR>
195
+ <TR><TD ALIGN=CENTER>
196
+ The iTunes Link Maker is provided by Apple as an accommodation only.<br>Apple assumes no responsibility for your use of any links, and makes no representation regarding their accuracy or performance. <br>Nothing shall be construed as permission or a grant by Apple in relation to the use of any artist, track or album name,<br> and you agree that any use by you, or result from your use, shall be solely your responsibility.<br>Apple reserves the right to de-activate links at its sole discretion.
197
+ <br/><br/>
198
+
199
+
200
+ <!-- <a href="MHITMSLinkGeneratorWrapper.FaqUrl">FAQ</a> | -->
201
+ <a href="mailto:musicstore@apple.com">Contact Us</a>
202
+ <BR>Copyright &copy; 2008 Apple Inc. All rights reserved.</td></tr>
203
+ <img width="1" height="1" src="http://metrics.apple.com/b/ss/applesuperglobal/1/G.6--NS?pageName=iTMS+Link+Picker-US&pccr=true&h5=appleitmsna%2Cappleitmsus&ch=iTMS+Link+Picker&g=http%3A%2F%2Fax.phobos.apple.com.edgesuite.net%2FWebObjects%2FMZStoreServices.woa%2Fwa%2FitmsSearchDisplayUrl%3Fdesc%3DThe%2BPostal%2BService%2B-%2BGive%2BUp%2B-%2BSuch%2BGreat%2BHeights%26WOURLEncoding%3DISO8859_1%26lang%3D1%26url%3Dhttp%253A%252F%252Fphobos.apple.com%252FWebObjects%252FMZStore.woa%252Fwa%252FviewAlbum%253Fi%253D2522315%2526id%253D2522333%2526s%253D143441">
204
+
205
+ </BODY>
206
+ </HTML>
@@ -0,0 +1,92 @@
1
+ require File.dirname(__FILE__) + '/spec_helper.rb'
2
+
3
+ describe ItunesLinkMaker do
4
+ setup do
5
+ @open_result = mock('open result', :read => '')
6
+ ItunesLinkMaker.stub!(:open).and_return(@open_result)
7
+ end
8
+
9
+ def search
10
+ ItunesLinkMaker.search('search query')
11
+ end
12
+
13
+ it "should be searchable given a query" do
14
+ search
15
+ end
16
+
17
+ it "should return an array of results" do
18
+ search.should be_an_instance_of(Array)
19
+ end
20
+
21
+ it "should send a GET request to the iTunes search URL" do
22
+ ItunesLinkMaker.should_receive(:open).with(
23
+ "http://ax.phobos.apple.com.edgesuite.net/WebObjects/MZStoreServices.woa/wa/itmsSearch?WOURLEncoding=ISO8859_1&lang=1&output=lm&country=US&term=search+query&media=music"
24
+ ).and_return(@open_result)
25
+ search
26
+ end
27
+ end
28
+
29
+
30
+ describe "Itunes link search with no hits" do
31
+ setup do
32
+ @open_result = mock('open result', :read => read_fixture('no_results.html'))
33
+ ItunesLinkMaker.stub!(:open).and_return(@open_result)
34
+ end
35
+
36
+ def search
37
+ ItunesLinkMaker.search('kafoozl')
38
+ end
39
+
40
+ it "should return an empty array" do
41
+ search.should be_empty
42
+ end
43
+ end
44
+
45
+
46
+ describe "Itunes quick search with no hits" do
47
+ setup do
48
+ @open_result = mock('open result', :read => read_fixture('no_results.html'))
49
+ ItunesLinkMaker.stub!(:open).and_return(@open_result)
50
+ end
51
+
52
+ def quick_search
53
+ ItunesLinkMaker.quick_search('kafoozl')
54
+ end
55
+
56
+ it "should return nil" do
57
+ quick_search.should be_nil
58
+ end
59
+ end
60
+
61
+
62
+ describe "Itunes link search with multiple hits" do
63
+ setup do
64
+ @open_result = mock('open result', :read => read_fixture('has_results.html'))
65
+ ItunesLinkMaker.stub!(:open).and_return(@open_result)
66
+ end
67
+
68
+ def search
69
+ ItunesLinkMaker.search('postal service such great heights')
70
+ end
71
+
72
+ it "should return a non-empty array" do
73
+ search.should_not be_empty
74
+ end
75
+ end
76
+
77
+
78
+ describe "Itunes quick search with multiple hits" do
79
+ setup do
80
+ @open_result = mock('open result', :read => read_fixture('has_results.html'))
81
+ ItunesLinkMaker.stub!(:open).and_return(@open_result)
82
+ end
83
+
84
+ def quick_search
85
+ ItunesLinkMaker.quick_search('postal service such great heights')
86
+ end
87
+
88
+ it "should return the result object" do
89
+ expected = ItunesLinkMaker::Result.new('Such Great Heights', :name, '/WebObjects/MZStoreServices.woa/wa/itmsSearchDisplayUrl?desc=The+Postal+Service+-+Give+Up+-+Such+Great+Heights&WOURLEncoding=ISO8859_1&lang=1&url=http%3A%2F%2Fphobos.apple.com%2FWebObjects%2FMZStore.woa%2Fwa%2FviewAlbum%3Fi%3D2522315%26id%3D2522333%26s%3D143441')
90
+ quick_search.should == expected
91
+ end
92
+ end
@@ -0,0 +1,76 @@
1
+ require File.dirname(__FILE__) + '/spec_helper.rb'
2
+
3
+ describe ItunesLinkMaker::Result do
4
+ setup do
5
+ @open_result = mock('open result', :read => read_fixture('result.html'))
6
+ end
7
+
8
+ def create_result(options={})
9
+ options = {
10
+ :name => 'Such Great Heights',
11
+ :type => :name,
12
+ :display_url => '/WebObjects/MZStoreServices.woa/wa/itmsSearchDisplayUrl?desc=The+Postal+Service+-+Give+Up+-+Such+Great+Heights&WOURLEncoding=ISO8859_1&lang=1&url=http%3A%2F%2Fphobos.apple.com%2FWebObjects%2FMZStore.woa%2Fwa%2FviewAlbum%3Fi%3D2522315%26id%3D2522333%26s%3D143441'
13
+ }.merge(options)
14
+
15
+ ItunesLinkMaker::Result.new(options[:name], options[:type], options[:display_url])
16
+ end
17
+
18
+ it "should be instantiable with name, type and display url" do
19
+ create_result
20
+ end
21
+
22
+ it "should set the name and type instance variables" do
23
+ r = create_result
24
+ r.name.should == 'Such Great Heights'
25
+ r.type.should == :name
26
+ end
27
+
28
+ it "should be equal to a result with identical name, type and url" do
29
+ r1, r2 = create_result, create_result
30
+ r1.should eql(r2)
31
+ end
32
+
33
+ it "should not be equal to a result with a different name" do
34
+ r1 = create_result
35
+ r2 = create_result(:name => 'Different')
36
+ r1.should_not eql(r2)
37
+ end
38
+
39
+ it "should not be equal to a result with a different type" do
40
+ r1 = create_result
41
+ r2 = create_result(:type => 'Different')
42
+ r1.should_not eql(r2)
43
+ end
44
+
45
+ it "should not be equal to a result with a different display url" do
46
+ r1 = create_result
47
+ r2 = create_result(:display_url => 'Different')
48
+ r1.should_not eql(r2)
49
+ end
50
+
51
+ it "should GET the display page when accessing the url" do
52
+ r = create_result
53
+ r.should_receive(:open).with("http://ax.phobos.apple.com.edgesuite.net/WebObjects/MZStoreServices.woa/wa/itmsSearchDisplayUrl?desc=The+Postal+Service+-+Give+Up+-+Such+Great+Heights&WOURLEncoding=ISO8859_1&lang=1&url=http%3A%2F%2Fphobos.apple.com%2FWebObjects%2FMZStore.woa%2Fwa%2FviewAlbum%3Fi%3D2522315%26id%3D2522333%26s%3D143441").and_return(@open_result)
54
+ r.url
55
+ end
56
+
57
+ it "should return the correct url" do
58
+ r = create_result
59
+ r.stub!(:open).and_return(@open_result)
60
+ r.url.should == 'http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewAlbum?i=2522315&id=2522333&s=143441'
61
+ end
62
+
63
+ it "should work correctly with uniq" do
64
+ r1 = create_result
65
+ r2 = create_result
66
+ r3 = create_result(:name => 'Different')
67
+ [r1, r2, r3].uniq.should == [r1, r3]
68
+ end
69
+
70
+ it "should cache the url" do
71
+ r = create_result
72
+ r.should_receive(:open).once.and_return(@open_result)
73
+ r.url
74
+ r.url
75
+ end
76
+ end
@@ -0,0 +1,5 @@
1
+ require File.dirname(__FILE__) + '/../lib/itunes_link_maker.rb'
2
+
3
+ def read_fixture(file)
4
+ open(File.join(File.dirname(__FILE__), 'fixtures', file)).read
5
+ end
metadata ADDED
@@ -0,0 +1,60 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: itunes_link_maker
3
+ version: !ruby/object:Gem::Version
4
+ version: "1.0"
5
+ platform: ruby
6
+ authors:
7
+ - Sam Pohlenz
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2008-04-17 00:00:00 -07:00
13
+ default_executable:
14
+ dependencies: []
15
+
16
+ description:
17
+ email: sam@sampohlenz.com
18
+ executables: []
19
+
20
+ extensions: []
21
+
22
+ extra_rdoc_files: []
23
+
24
+ files:
25
+ - lib/itunes_link_maker.rb
26
+ - lib/result.rb
27
+ has_rdoc: false
28
+ homepage: http://itms-link-maker.rubyforge.org/
29
+ post_install_message:
30
+ rdoc_options: []
31
+
32
+ require_paths:
33
+ - lib
34
+ required_ruby_version: !ruby/object:Gem::Requirement
35
+ requirements:
36
+ - - ">="
37
+ - !ruby/object:Gem::Version
38
+ version: "0"
39
+ version:
40
+ required_rubygems_version: !ruby/object:Gem::Requirement
41
+ requirements:
42
+ - - ">="
43
+ - !ruby/object:Gem::Version
44
+ version: "0"
45
+ version:
46
+ requirements: []
47
+
48
+ rubyforge_project: itms-link-maker
49
+ rubygems_version: 1.0.1
50
+ signing_key:
51
+ specification_version: 2
52
+ summary: Create iTunes links
53
+ test_files:
54
+ - spec/fixtures
55
+ - spec/fixtures/has_results.html
56
+ - spec/fixtures/no_results.html
57
+ - spec/fixtures/result.html
58
+ - spec/itunes_link_maker_spec.rb
59
+ - spec/result_spec.rb
60
+ - spec/spec_helper.rb