Skip to content

Instantly share code, notes, and snippets.

@jxpsert
Created December 6, 2023 08:33
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 jxpsert/a951aea47ab5d72c08cc4fe201bd183a to your computer and use it in GitHub Desktop.
Save jxpsert/a951aea47ab5d72c08cc4fe201bd183a to your computer and use it in GitHub Desktop.
Frequentiedatabase punten
// ==UserScript==
// @name Frequentiedatabase komma naar punt
// @namespace https://ptdk.nl/
// @version 0.1
// @description Verandert komma's in frequenties naar punten
// @author Jxpsert
// @match https://frequentiedatabase.eu/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=frequentiedatabase.eu
// @grant none
// ==/UserScript==
(function() {
'use strict';
const freqs = document.querySelectorAll("td > a");
const freqs2 = document.querySelectorAll("td"); // TX kolom
freqs.forEach(freq => {
const href = freq.href;
const lastChar = href.charAt(href.length - 1);
if(isNaN(lastChar)) return; // Kijken of het einde van de link een frequentie is- zo niet, doen we er niks mee
freq.innerText = freq.innerText.replace(",", ".");
});
freqs2.forEach(freq => {
const lastChar = freq.innerText.charAt(freq.innerText.length - 1);
if(isNaN(lastChar)) return; // Kijken of het einde van de link een frequentie is- zo niet, doen we er niks mee
freq.innerText = freq.innerText.replace(",", ".");
});
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment