Created
September 24, 2018 07:56
-
-
Save asbjornu/11ed3fb166a5a5499e224ae410768ec0 to your computer and use it in GitHub Desktop.
Removes reposts from your SoundCloud stream
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
// ==UserScript== | |
// @name SoundCloud No Reposts | |
// @version 1 | |
// @grant none | |
// ==/UserScript== | |
(function repeat() { | |
var posts = document.getElementsByClassName('soundList__item'); | |
var skip = []; | |
for (var i = 0; i < posts.length; i++) { | |
if (posts[i].innerHTML.indexOf('Reposted') !== -1) { | |
skip.push(posts[i].getElementsByClassName("soundTitle__title")[0].getElementsByTagName('span')[0].innerHTML); | |
posts[i].parentNode.removeChild(posts[i]); | |
} | |
} | |
var check = document.getElementsByClassName("playbackSoundBadge__titleContextContainer")[0]; | |
if (check !== undefined) { | |
var curSongHolder = check.getElementsByTagName('a')[1]; | |
for (var i = 0; i < skip.length; i++) { | |
if (skip[i] === curSongHolder.innerHTML) { | |
console.log('gah'); | |
skipButton.click(); | |
} | |
} | |
} | |
setTimeout(repeat, 300); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment