Skip to content

Instantly share code, notes, and snippets.

@simonszu
Last active February 3, 2021 08:11
Show Gist options
  • Save simonszu/553eab51b292361b8ad7b74f647012a0 to your computer and use it in GitHub Desktop.
Save simonszu/553eab51b292361b8ad7b74f647012a0 to your computer and use it in GitHub Desktop.
RN Decrypt
// ==UserScript==
// @name RN Decrypt
// @description Decrypt RN Posts
// @include https://www.ruhrnachrichten.de/*
// @grant none
// ==/UserScript==
// Install uBlock and block *$script,domain=ruhrnachrichten.de for hiding the "Please subscribe" layover
(function() {
var key="az by cx dw ev fu gt hs ir jq kp lo mn ,ü ßä ?ö AÖ BÜ CÄ DZ EY FX GW HV IU JT KS LR MQ NP 09 18 27 36 45";
var h={};
key.split(" ").forEach(
function(pair) {
h[pair[0]]=pair[1]; h[pair[1]]=pair[0];
});
var count=document.evaluate('count(//div[@class="PremiumContent PianoContent"]/p)', document, null, XPathResult.ANY_TYPE, null).numberValue;
console.log(count);
for(var i=0; i<count;i++) {
var elm=document.evaluate('//div[@class="PremiumContent PianoContent"]/p[' + (i+1) + ']/text()', document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
if (!elm) continue;
elm.textContent = (elm.textContent.split("").map(function(c) {
if (c in h) return h[c];
else return c;
}).join(""));
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment