DestinyLFG.com refresher

Refreshes the DestinyLFG.com list automatically

คุณจะต้องติดตั้งส่วนขยาย เช่น Tampermonkey, Greasemonkey หรือ Violentmonkey เพื่อติดตั้งสคริปต์นี้

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

คุณจะต้องติดตั้งส่วนขยาย เช่น Tampermonkey หรือ Violentmonkey เพื่อติดตั้งสคริปต์นี้

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       DestinyLFG.com refresher
// @version    0.1
// @description  Refreshes the DestinyLFG.com list automatically
// @match      http://www.destinylfg.com
// @copyright  2014+, You
// @namespace https://greatest.deepsurf.us/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);