Created
June 13, 2012 15:10
-
-
Save EndangeredMassa/2924665 to your computer and use it in GitHub Desktop.
Grooveshark ease of use
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
// Config | |
var userName = 'endangeredmassa'; | |
// Utils | |
function waitsFor(condition, callback){ | |
if (condition()) | |
callback(); | |
else | |
setTimeout(function(){ | |
waitsFor(condition, callback); | |
}, 100); | |
}; | |
// default to My Music | |
if(window.location.hash === '') | |
window.location.hash = '#!/' + userName + '/music'; | |
// wait for the ad and click the close button | |
$('body').delegate('.play.count', 'click', function(){ | |
var condition = function(){ | |
return $('#resumePlaybackButton.active').length > 0; | |
}; | |
waitsFor(condition, function(){ | |
$('#resumePlaybackButton.active').click(); | |
console.log('clicking #resumePlaybackButton.active'); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment