View difference between Paste ID: VpLwjWdM and y4GCKwZL
SHOW: | | - or go back to the newest paste.
1
// ==UserScript==
2
// @name           Debinarize
3
// @namespace      szzs.ph
4
// @description    Egyértelmű :)
5
// ==/UserScript==
6
7
/*
8
 
9
debinarize script :)
10
11
Versions:
12
0.1     Initial release
13
0.2     Identify decoded text
14
15
16
*/
17
18
function main() {
19
    var rx = /((?:[01]{8}\s*)+)/g
20
    var header;
21
    header = document.getElementsByClassName("text");
22
    if (header != null) {
23
        for (var x = 0; x < header.length; x++) {
24
            var it = header[x].innerHTML;
25
            while (rx.test(it)) {
26
                it = it.replace(rx, binreplace);
27
            }
28
            header[x].innerHTML = it
29
        }
30
    }
31-
    header = document.getElementsByClassName("cntcol");
31+
    header = document.getElementsByClassName("anyag hir");
32
    if (header != null) {
33
        for (var x = 0; x < header.length; x++) {
34
            var it = header[x].innerHTML;
35
            while (rx.test(it)) {
36
                it = it.replace(rx, binreplace);
37
            }
38
            header[x].innerHTML = it
39
        }
40
    }
41
}
42
43
function binreplace(r1) {
44
    var rx = /([01]{8}\s*)/g
45
    r1 = r1.replace(rx, binreplace2);
46
    return "{b}" + r1;
47
}
48
49
function binreplace2(r1) {
50
    return String.fromCharCode(parseInt(r1, 2));
51
}
52
53
function URLCheck() {
54
    var url = document.URL;
55
    var sites = Array(
56
        "http://prohardver.hu",
57
        "http://itcafe.hu",
58
        "http://logout.hu",
59
        "http://mobilarena.hu",
60
        "http://gamepod.hu");
61
62
    for (var x = 0; x < sites.length; x++) {
63
        if (url.indexOf(sites[x]) == 0) {
64
            return true;
65
        }
66
    }
67
    return false;
68
}
69
if (URLCheck)
70-
    if (document.URL.indexOf("/re_a_heten_rendezik_a_kodolas_orajat") > 0) {
70+
    if (document.URL.indexOf("a_heten_rendezik_a_kodolas_orajat") > 0) {
71
        main();
72
    }