-
-
Save jasondavis/4474828 to your computer and use it in GitHub Desktop.
This file contains hidden or 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