Last active
February 3, 2021 08:11
-
-
Save simonszu/553eab51b292361b8ad7b74f647012a0 to your computer and use it in GitHub Desktop.
RN Decrypt
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 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