Skip to content

Instantly share code, notes, and snippets.

@volkanbicer
Created July 11, 2018 08:13
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 volkanbicer/a8b2411c92b0d9cdeff0350d901b466a to your computer and use it in GitHub Desktop.
Save volkanbicer/a8b2411c92b0d9cdeff0350d901b466a to your computer and use it in GitHub Desktop.
ITunes charts customizer.
function removeByCategory(category){
let allLinks = document.getElementsByTagName('a')
let links = []
for(let i = 0; i<allLinks.length; i++){
if(allLinks[i].text === category){
links.push(allLinks[i])
}
}
console.log(links.length, 'Removed')
for(let i = 0; i<links.length; i++){
let link = links[i]
link.parentNode.parentNode.remove()
}
}
/*
Usage
removeByCategory('Games')
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment