-
Notifications
You must be signed in to change notification settings - Fork 3
/
Spiegel_Plus.user.js
55 lines (43 loc) · 1.47 KB
/
Spiegel_Plus.user.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// ==UserScript==
// @name Spiegel Plus
// @namespace LX
// @description zeigt vollständige Spiegel Plus Artikel an
// @include http://www.spiegel.de/*
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
// @version 1.2
// @grant GM_addStyle
// ==/UserScript==
String.prototype.rot1 = rot1 = function(s)
{
return (s = (s) ? s : this).split('').map(function(_)
{
if ( _ == ' ' ) return ' ';
if ( _ == '´' ) return ';';
if ( _ == '²' ) return '!';
// if ( _ == '&' ) return '&';
return String.fromCharCode(_.charCodeAt(0) - 1);
}).join('');
};
$('.js-spiegelplus-obfuscated-intro').remove();
$('.obfuscated').removeClass('obfuscated').addClass('decrypt');
$('.decrypt').each(function(){
var $paragraph = $(this);
// Links sind unverschlüsselt, die nehmen wir also vorher raus
var $links = [];
$('a.text-link-int, a.text-link-ext', $paragraph).each(function(){
$links.push($(this)[0].outerHTML);
$(this).replaceWith('§§§§§'+$links.length);
});
var decrypted = $paragraph.text().rot1();
$paragraph.text( decrypted );
// dann Links wieder einfügen
$.each($links, function(i, link){
var regexp = new RegExp('¦¦¦¦¦'+i, 'g');
$paragraph.html($paragraph.html().replace(regexp, link));
});
});
var content = $('.obfuscated-content').html();
$('.article-section > div:last').remove();
$('.article-section > div:last').remove();
$('.article-section').append(content);
$('#laterpay-replacement').remove();