Bitcointalk.org Autoreload

Automatically reloads the watchlist/unread posts

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         Bitcointalk.org Autoreload
// @name:de      Bitcointalk.org Autoreload
// @homepage     http://greasyfork.org/scripts/19125-bitcointalk-org-autoreload/
// @homepage     http://openuserjs.org/scripts/LsHallo/Bitcointalk.org_Autoreload
// @version      0.64
// @iconURL      https://greasyfork.org/system/screenshots/screenshots/000/003/979/thumb/logo.png?1461614733
// @description    Automatically reloads the watchlist/unread posts
// @description:de Automatischer reload der post seiten bei bitcointalk
// @author       LsHallo
// @match        https://bitcointalk.org/index.php?action=watchlist
// @match        https://bitcointalk.org/index.php?action=unreadreplies
// @namespace https://greasyfork.org/en/scripts/19125-bitcointalk-org-autoreload/
// ==/UserScript==

load();
var y, x, link;

function changeTitle(state) {
    if(state === 0) {
        document.title = x + " Unread Posts";
        document.getElementById('faviconprovider').href = 'https://greasyfork.org/system/screenshots/screenshots/000/003/979/thumb/logo.png?1461614733';
        setTimeout(function(){changeTitle(1);},2000);
    } else {
        document.title = y;
        document.getElementById('faviconprovider').href = 'https://bitcointalk.org/favicon.ico';
        setTimeout(function(){changeTitle(0);},2000);
    }
}

function load() {
    y = document.title;
    time = ~~(Math.random()*75953+105896);
    console.log("Idle time: " + ~~(time/1000) + " seconds (" + ((time/1000).toFixed(0)/60).toFixed(2)+" minutes)");
    setTimeout(function(){location.reload();},time);

    d = new Date();
    if(d.getHours() < 10) Hours = "0"+d.getHours(); else Hours = d.getHours();
    if(d.getMinutes() < 10) Minutes = "0"+d.getMinutes(); else Minutes = d.getMinutes();
    if(d.getSeconds() < 10) Seconds = "0"+d.getSeconds(); else Seconds = d.getSeconds();

    console.log("Last reload: " + Hours + ":" + Minutes + ":" + Seconds);

    x = document.getElementsByClassName("windowbg").length/3;
    if(x > 0) {
        link = document.createElement('link');
        link.type = 'image/x-icon';
        link.rel = 'shortcut icon';
        link.id = 'faviconprovider';
        link.href = 'https://greasyfork.org/system/screenshots/screenshots/000/003/979/thumb/logo.png?1461614733';
        document.getElementsByTagName('head')[0].appendChild(link);
        changeTitle(0);
    }
}