Created
April 15, 2012 00:15
-
-
Save frankdenbow/2388988 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
sp = getSpotifyApi(1); | |
var models = sp.require('sp://import/scripts/api/models'); | |
var gtrack = sp.require("sp://import/scripts/googletracker"); | |
var tracker = new gtrack.GoogleTracker('UA–xxxxxxx–1'); | |
var args = sp.core.getArguments(); | |
var search = new models.Search("rhianna"); | |
//console.log(args[1]); | |
function tabs() { | |
var args = models.application.arguments; | |
//console.log("Argument: " + args[0]); | |
$('.section').hide(); | |
$('#'+args[0]).show(); | |
} | |
tabs(); | |
models.application.observe(models.EVENT.ARGUMENTSCHANGED, tabs); | |
search.localResults = models.LOCALSEARCHRESULTS.APPEND; | |
search.observe(models.EVENT.CHANGE, function() { | |
search.tracks.forEach(function(track) { | |
console.log(track.name); | |
}); | |
}); | |
search.appendNext(); | |
$('#search').keyup(function(){ | |
var query = $(this).val(); | |
if(query.length > 3){ | |
console.log(query); | |
search = new models.Search(query); | |
search.appendNext(); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment