Gotoquiz refresh posts.

Refresh the posts on gotoquiz forums

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

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

(I already have a user script manager, let me install it!)

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.

(I already have a user style manager, let me install it!)

// ==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();
            }
            }
        }
    })
}