Saucsse / Respawn Subscriber Shortcut

// ==UserScript==
// @name         Respawn Subscriber Shortcut
// @version      1.3
// @description  Add reload 
// @author       Craftbukkit
// @require      http://code.jquery.com/jquery-2.2.0.min.js
// @match        http://www.jeuxvideo.com/forums/42-*
// @match        http://www.jeuxvideo.com/forums/1-*
// @grant        none
// @run-at       document-end
// ==/UserScript==
function refreshFresh()
{
    var splitage = document.getElementsByClassName("bloc-header");
    for(var k=0;k<splitage.length;k++)
    {
        if(splitage[k].innerHTML.indexOf("max-width: 330px; font-style: italic;") == "-1" && splitage[k].getElementsByTagName("a")[0].innerHTML.trim() != document.body.innerHTML.split('<span class="account-pseudo">')[1].split('<')[0])
        {
            var pseudo = splitage[k].getElementsByTagName("a")[0].href;
            $.get(pseudo+"&"+k, function(data,succes){ addNearMess(this.url, data);  });
        }  
    }
}

function addNearMess(k, data)
{
    k = k.split("&")[1];
    var dataId = "";
    var dataAbo = "";
    var aboSess = data.split('data-abo-session="')[1].split('"')[0];
    if(data.indexOf('picto-guyplus"') != "-1")
    {
        dataId = data.split('guyplus" data-id="')[1].split('"')[0];
        if(document.getElementById('img'+k) == undefined)
        {
            var blabla = document.createElement('a');
            blabla.setAttribute('id', 'img'+k);
            var blablabla = document.createElement('img');
            blablabla.src = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAAPCAYAAADphp8SAAAACXBIWXMAAA3XAAAN1wFCKJt4AAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAADXSURBVHjajJJBCsMgFETnt/UmOYSbXqir7nOLniEX6NZdblEoZBMolGxKt2KnG0NUjPrgk2Ty/6iDIImghGRP8knS+mfvdZQq+nDOXZjB6+1G0zQ9ckZeLxoJSaxYa51S6oAEa+1PKXVEgWhonmfJNe3pu0bjOH5zTXt6RHhOrfVgjInyMcZQaz0kmazkwwbQAYicABgAXc0oCjvcaPAuhf+Sy+gM4A7glQx9gmEmi2ya39qNZcCGhivrRKsH4lbLsrxbjFrCJupILeyTiDTdtcjVz4T6fwB0AgKU7ot2wgAAAABJRU5ErkJggg==';
            blabla.onclick = function() { $.post("http://www.jeuxvideo.com/abonnements/ajax/ajax_abo_insert.php", "type=alias&ajax_hash="+aboSess+"&ids_liste="+dataId , function(data,succes){refreshFresh();  }); };
            blabla.appendChild(blablabla);
            document.getElementsByClassName("bloc-options-msg")[k].appendChild(blabla);        
        }
        else
        {
            var blabla = document.getElementById('img'+k);
            var blablabla = blabla.getElementsByTagName('img')[0];
            blablabla.src = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAAPCAYAAADphp8SAAAACXBIWXMAAA3XAAAN1wFCKJt4AAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAADXSURBVHjajJJBCsMgFETnt/UmOYSbXqir7nOLniEX6NZdblEoZBMolGxKt2KnG0NUjPrgk2Ty/6iDIImghGRP8knS+mfvdZQq+nDOXZjB6+1G0zQ9ckZeLxoJSaxYa51S6oAEa+1PKXVEgWhonmfJNe3pu0bjOH5zTXt6RHhOrfVgjInyMcZQaz0kmazkwwbQAYicABgAXc0oCjvcaPAuhf+Sy+gM4A7glQx9gmEmi2ya39qNZcCGhivrRKsH4lbLsrxbjFrCJupILeyTiDTdtcjVz4T6fwB0AgKU7ot2wgAAAABJRU5ErkJggg==';
            blabla.onclick = function () { return false; }
            blabla.onclick = function() { $.post("http://www.jeuxvideo.com/abonnements/ajax/ajax_abo_insert.php", "type=alias&ajax_hash="+aboSess+"&ids_liste="+dataId , function(data,succes){ refreshFresh(); }); };
        }
    }
    else
    {
        dataAbo = data.split('guymoins" data-abo="')[1].split('"')[0];
        if(document.getElementById('img'+k) == undefined)
        {
            var blabla = document.createElement('a');
            blabla.setAttribute('id', 'img'+k);
            var blablabla = document.createElement('img');
            blablabla.src = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAAPCAYAAADphp8SAAAACXBIWXMAAA3XAAAN1wFCKJt4AAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAF2SURBVHjajJMxSwNBFIS/TTgFm9QmYKX+hmtS5IiNiLWYwiYkYCG2kh8hCBHOWgtLUSxOUCL4H4RAmoBVCmMRopfLWNwl3MXkzMBjd+ftG97O7iKJWBhJDUltSX40NiKetEgsgiA41hxE/PJCnU7nfZ5QxKcKGUlM4Pt+YFlWhhn4vj+2LCtLChJF3W7XzNu0iF8o1Gq1vuZtWsQnED+nbdvXnucl/PE8T7ZtX0tCVRzVcKc1NVxVcf54ZIzZBC4l7cS4J+BYVTYCw2PWsApUovRNIL6zYjchFG80NjcA7QNzv5VjD8AfMwCwMqwBtPs8xD0qAnfAx4zoJ8D2LR+VZ+j/hAJWhrX+D1Sew9xE6AJ4BfaB9RmhXORlvZSnaWLdGlApT1NS3Ug6Bc7/uRND3bhADcKuAHIr0/xVptfrnbEEjl7ID0bh/OSNwclb6NNgFObQcgBwygWGbhEBh8ChW0TlAkPAmdxQakw/ZljgxtYuhO/odwDERIvaifYMPQAAAABJRU5ErkJggg==';
            blabla.onclick = function() {  $.post("http://www.jeuxvideo.com/abonnements/ajax/ajax_abo_delete.php", "ajax_hash="+aboSess+"&id="+dataAbo , function(data,succes){refreshFresh();  }); };
            blabla.appendChild(blablabla);
            document.getElementsByClassName("bloc-options-msg")[k].appendChild(blabla);  
        }
        else
        {
            var blabla = document.getElementById('img'+k);
            var blablabla = blabla.getElementsByTagName('img')[0];
            blablabla.src = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAAPCAYAAADphp8SAAAACXBIWXMAAA3XAAAN1wFCKJt4AAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAF2SURBVHjajJMxSwNBFIS/TTgFm9QmYKX+hmtS5IiNiLWYwiYkYCG2kh8hCBHOWgtLUSxOUCL4H4RAmoBVCmMRopfLWNwl3MXkzMBjd+ftG97O7iKJWBhJDUltSX40NiKetEgsgiA41hxE/PJCnU7nfZ5QxKcKGUlM4Pt+YFlWhhn4vj+2LCtLChJF3W7XzNu0iF8o1Gq1vuZtWsQnED+nbdvXnucl/PE8T7ZtX0tCVRzVcKc1NVxVcf54ZIzZBC4l7cS4J+BYVTYCw2PWsApUovRNIL6zYjchFG80NjcA7QNzv5VjD8AfMwCwMqwBtPs8xD0qAnfAx4zoJ8D2LR+VZ+j/hAJWhrX+D1Sew9xE6AJ4BfaB9RmhXORlvZSnaWLdGlApT1NS3Ug6Bc7/uRND3bhADcKuAHIr0/xVptfrnbEEjl7ID0bh/OSNwclb6NNgFObQcgBwygWGbhEBh8ChW0TlAkPAmdxQakw/ZljgxtYuhO/odwDERIvaifYMPQAAAABJRU5ErkJggg==';
            blabla.onclick = function () { return false; }
            blabla.onclick = function() {  $.post("http://www.jeuxvideo.com/abonnements/ajax/ajax_abo_delete.php", "ajax_hash="+aboSess+"&id="+dataAbo , function(data,succes){refreshFresh();  }); };

        }
    }
}

refreshFresh();