Gotoquiz refresh posts.

Refresh the posts on gotoquiz forums

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name        Gotoquiz refresh posts.
// @namespace   http://localhost
// @description Refresh the posts on gotoquiz forums
// @include     http://www.gotoquiz.com/forum/*
// @include     http://gotoquiz.com/forum/*
// @version     1
// @grant       GM_xmlhttpRequest
// ==/UserScript==
url = window.location.href;
u = url.split('/');
loop=[];
if (u[3] == 'forum' && u.length >= 7) {
    go = true;
}
if(go && u[6]=="thread.html"){
    n=1;
    refresh();
}
else if(go){
    n=u[6];
    refresh();
}
function refresh(){
    GM_xmlhttpRequest({
        method: 'GET',
        url: 'http://gotoquiz.com/forum/offbeat/' + u[5] + '/' + n + '/thread.html',
        onreadystatechange: function (response) {
            if(url==window.location.href){
            if(response.readyState==4){
            last=response.responseText;
            last=last.split('<table id="f_board">')[1];
            last=last.split('</table>')[0];
            document.getElementById("f_board").innerHTML=last;
            refresh();
            }
            }
        }
    })
}