Created
February 17, 2022 15:06
-
-
Save prikkprikkprikk/51fe727a2a3cae0777de8ce5294408b0 to your computer and use it in GitHub Desktop.
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 SportBort | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Away with the sport articles! | |
// @author Prikkprikkprikk | |
// @match https://www.nrk.no/ | |
// @icon https://www.google.com/s2/favicons?domain=nrk.no | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
const apartments = document.querySelectorAll('.kur-floor--apartment') | |
apartments.forEach(apartment => { | |
const apartmentTitle = apartment.querySelector('div h2') | |
if( apartmentTitle.textContent.toLowerCase().includes('ol i beijing 2022')) { | |
apartment.remove() | |
} | |
}) | |
const articles = document.querySelectorAll('[class*="kur-room"]'); | |
articles.forEach(article => { | |
article.querySelectorAll('[href*="sport"]').forEach(sportArticle => { | |
sportArticle.remove() | |
}) | |
}) | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment