Bitcointalk.org Autoreload

Automatically reloads the watchlist/unread posts

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

Bạn sẽ cần cài đặt một tiện ích mở rộng như Tampermonkey hoặc Violentmonkey để cài đặt kịch bản này.

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.

(Tôi đã có Trình quản lý tập lệnh người dùng, hãy cài đặt nó!)

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         Bitcointalk.org Autoreload
// @name:de      Bitcointalk.org Autoreload
// @homepage     http://greatest.deepsurf.us/scripts/19125-bitcointalk-org-autoreload/
// @homepage     http://openuserjs.org/scripts/LsHallo/Bitcointalk.org_Autoreload
// @version      0.64
// @iconURL      https://greatest.deepsurf.us/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://greatest.deepsurf.us/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://greatest.deepsurf.us/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://greatest.deepsurf.us/system/screenshots/screenshots/000/003/979/thumb/logo.png?1461614733';
        document.getElementsByTagName('head')[0].appendChild(link);
        changeTitle(0);
    }
}