Skip to content

Instantly share code, notes, and snippets.

@sdennler
Last active November 23, 2020 17:45
Show Gist options
  • Save sdennler/5b1c4c14253f34dc75c0e46e2eb72882 to your computer and use it in GitHub Desktop.
Save sdennler/5b1c4c14253f34dc75c0e46e2eb72882 to your computer and use it in GitHub Desktop.

Synopsis

Ads the CHE nummber to the top of the company description.

Motivation

Why scroll down?

Installation

  1. Install user script manager in your browser:
  1. Open this link and install the script:

License

Public Domain

Ads the CHE nummber to the top of the company description.
// ==UserScript==
// @name Sad moneyhouse improver
// @namespace http://tampermonkey.net/
// @version 2
// @description try to fix the world!
// @author Sad
// @match https://www.moneyhouse.ch/*/company/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
var infoBlock = document.getElementsByClassName("l-grid-cell l-one-third l-mobile-one-whole")[1];
var infoBlockP = infoBlock.getElementsByTagName("p");
var headerInfo = document.getElementsByClassName("chnr")[0].parentNode;
for (let i = 0; i < infoBlockP.length; i++) {
if(infoBlockP[i].innerText.startsWith('CHE')){
let che = infoBlockP[i].innerText.replaceAll(/\.|-/g, '');
let div = document.createElement('div');
div.innerText = 'UID/MWST: ' + che;
div.style = 'color: #f9654f;';
headerInfo.append(div);
console.log(che, div);
break;
}
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment