DestinyLFG.com refresher

Refreshes the DestinyLFG.com list automatically

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name       DestinyLFG.com refresher
// @version    0.1
// @description  Refreshes the DestinyLFG.com list automatically
// @match      http://www.destinylfg.com
// @copyright  2014+, You
// @namespace https://greasyfork.org/users/2353
// ==/UserScript==

var d = document;
function main () {
    var t=10000, f = function () {
        if(!$(".modal-dialog").is(":visible") && $(".AutoRefresh").is(":checked")){
            $(".refreshTime").text(tf())
        	$("#refresh").click();
        }
        setTimeout(f, t);
    }, tf = function (){
        var d = new Date(), h = d.getHours(), m = String(d.getMinutes()), s = String(d.getSeconds()),
        	st = (h > 12 ? h - 12 : h) + ":" + (m.length == 1 ? "0" + m : m) + ":" + (s.length == 1 ? "0" + s : s) + " " + (h > 12 ? "pm" : "am");
        return st;
    }
    
    $(".panel-body>.row:first-child").clone().empty()
    	.append("<span style='padding-left:15px'><input type='checkbox' class='AutoRefresh' checked='true'/> Auto Refresh (Last refresh: <span class='refreshTime'>"+tf()+"</span>)</span>")
    	.insertAfter(".panel-body>.row:nth-child(2)");
    
    setTimeout(f, t);
}

var s = d.createElement("script");
s.appendChild(d.createTextNode('('+main+')()'));
(d.head || d.body || d.documentElement).appendChild(s);