Skip to content

Instantly share code, notes, and snippets.

@Beyarz
Last active October 29, 2020 23:02
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 Beyarz/6d7553a4eb19db2d16c73fb64380c158 to your computer and use it in GitHub Desktop.
Save Beyarz/6d7553a4eb19db2d16c73fb64380c158 to your computer and use it in GitHub Desktop.
Get rid of all the articles from the sports category on aftonbladet.se
// ==UserScript==
// @name Aftonbladet sportfilter
// @description Filter out sport related articles
// @match https://*.aftonbladet.se/*
// ==/UserScript==
window.addEventListener('DOMContentLoaded', () => {
//let x = document.getElementsByClassName('abTheme-sportbladet')
let x = document.querySelectorAll('[href^="/sportbladet"]')
for (let z=0; z <= x.length - 1; z++) {
console.log(`[${z}] Removed: ${x[z]}`)
x[z].remove()
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment