Created
October 11, 2012 18:03
-
-
Save jakiestfu/3874356 to your computer and use it in GitHub Desktop.
iTunes Search API
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var iTunes = (function() { | |
var endpoint = 'http://itunes.apple.com/search', | |
searchOptions = { | |
term: '', | |
country: 'US', | |
media: '', | |
entity: '', | |
attribute: '', | |
callback: 'iTunes.end', | |
limit: 50, | |
lang: 'en_us', | |
version: 2, | |
explicit: 'Yes' | |
}; | |
function doSearch(opts) { | |
var search = $.extend({}, searchOptions, opts); | |
$.ajax({ | |
url: endpoint + '?' + $.param(search), | |
dataType: 'jsonp' | |
}); | |
} | |
function receiveResults(data){} | |
return { | |
search: doSearch, | |
end: receiveResults | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment