Aufstellungsanzeige

Zeigt die Anzahl der Spieler die auf dem Feld sind auf der Fussballcup-Startseite an.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name       Aufstellungsanzeige
// @include  https://fussballcup.de/*
// @version    0.1.3
// @description  Zeigt die Anzahl der Spieler die auf dem Feld sind auf der Fussballcup-Startseite an.
// @copyright  Klaid, 2013 edited by mot33, 2018
// @grant  GM_xmlhttpRequest
// @namespace https://greasyfork.org/users/83290
// ==/UserScript==

window.setTimeout(function () { auf_count_number(); }, 2500);
window.setInterval(function() { auf_count_number(); }, 5000);

function auf_count_number()
{
    if(!document.getElementById("auf_count_number"))
    {
        document.getElementById("clubinfocard").getElementsByTagName("ul")[0].innerHTML += "<li id='auf_count_number'><span class='label'>Aufstellung:</span> wird geladen...</li>";
        document.getElementsByClassName("likebox")[0].style.marginBottom = "-40px";
    }
    
    GM_xmlhttpRequest({
        method: "GET",
        url: "http://fussballcup.de/index.php?w=301&area=user&module=formation&action=index&_=*&path=index.php&layout=none",
        headers: {"Content-Type": "application/x-www-form-urlencoded"},
        onload: function(responseDetails){
            var inhalt = responseDetails.responseText;
            var for_count = inhalt.indexOf('formation-count');
            var count_number_site = inhalt.substr(for_count, 50);
            count_number = count_number_site.match(/[0-9]{1,10}/);
            if(count_number == "11")
            {
                count_number = "vollständig";   
            }
            else
            {
                count_number = "<span style='color: red;'>unvollständig</span>";
            }
            
            document.getElementById("auf_count_number").innerHTML = "<li id='auf_count_number'><span class='label'>Aufstellung:</span> "+ String(count_number) +"</li>";
        }	
    });
}
window.onload = show_count;