Skip to content

Instantly share code, notes, and snippets.

@prikkprikkprikk
Created February 17, 2022 15:06
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 prikkprikkprikk/51fe727a2a3cae0777de8ce5294408b0 to your computer and use it in GitHub Desktop.
Save prikkprikkprikk/51fe727a2a3cae0777de8ce5294408b0 to your computer and use it in GitHub Desktop.
// ==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