Skip to content

Instantly share code, notes, and snippets.

@EndangeredMassa
Created June 13, 2012 15:10
Show Gist options
  • Save EndangeredMassa/2924665 to your computer and use it in GitHub Desktop.
Save EndangeredMassa/2924665 to your computer and use it in GitHub Desktop.
Grooveshark ease of use
// 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