-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathVroliz_Plus.user.js
More file actions
48 lines (38 loc) · 1.42 KB
/
Vroliz_Plus.user.js
File metadata and controls
48 lines (38 loc) · 1.42 KB
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
// ==UserScript==
// @name Vroliz plus
// @namespace http://b1nj.fr
// @description Améliore l'ergonomie du site Vroliz. Ajoute des liens vers la recherche Allo ciné.
// @include http://www.vroliz.com/*
// @version 0.2
// @grant none
// @copyright B1nj
// @license GPL version 3 or any later version; www.gnu.org/copyleft/gpl.htm
// @require https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js
// ==/UserScript==
$(function() {
// Déblocage automatiquement entrée site
var gtl = GetCookie('gtl');
if (gtl == 2) {
document.location.href = 'http://www.vroliz.com';
}
// Ajout liens Allo Ciné
var link = 'http://www.allocine.fr/recherche/?q=';
$('#polo span a').each(function() {
var regex = /[\t ]*(.*)[ ]*\([0-9]*\)[ A-Z]*/;
var input = $(this).text();
if(regex.test(input)) {
var match = input.match(regex);
$(this).parent().prepend('<a style="float: right" href="' + link + match[1] + '">Allo Ciné</a>');
}
});
if ($('.contentheading').length) {
console.log($('.contentheading').html());
var regex = /.*<\/font>[\t ]*(.*)[\t ]*<font.*/;
var input = $('.contentheading').html();
if(regex.test(input)) {
var match = input.match(regex);
console.log(match);
$('.contentheading').append('<a style="" href="' + link + match[1] + '">Allo Ciné</a>');
}
}
});