Skip to content

Instantly share code, notes, and snippets.

@rnmp
Forked from tylermenezes/remove-rdio-garbage.js
Created April 11, 2013 07:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rnmp/5361364 to your computer and use it in GitHub Desktop.
Save rnmp/5361364 to your computer and use it in GitHub Desktop.
(function(){
var i = 0;
var count = $('.Album.unavailable,.Album.preview').length;
console.log('Found ' + count + ' albums to remove');
var timeout = 0;
$('.Album.unavailable,.Album.preview').each(function(){
var instance_i = i++;
var album = $(this);
album.trigger('mouseover').mouseenter();
album.find('a,div,span,image').trigger('mouseover').mouseenter();
setTimeout(function(){
var album_menu = album.find('.ActionMenu');
album_menu.click();
setTimeout(function(){
$('.Menu').each(function(){
var menu = $(this);
if (menu.css('top').substring(0,1) != '-' && menu.find('.delete').length > 0) {
console.log("removing " + album.find('.album_title').text() + '(' + instance_i + '/' + count + ')');
var delete_button = menu.find('.delete');
delete_button.click();
setTimeout(function(){
$('#header').click();
}, 300);
}
});
}, 500);
}, timeout);
timeout += 2500;
});
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment