Skip to content

Instantly share code, notes, and snippets.

@jakiestfu
Created October 11, 2012 18:03
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jakiestfu/3874356 to your computer and use it in GitHub Desktop.
Save jakiestfu/3874356 to your computer and use it in GitHub Desktop.
iTunes Search API
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