Fanansehen

Zeigt das Fanansehen auf der Fussballcup-Startseite an.

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

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

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.

(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       Fanansehen
// @include  https://fussballcup.de/*
// @version    0.1.5
// @connect      <value>
// @description  Zeigt das Fanansehen 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() { change(); }, 2500);
window.setInterval(function() { change(); }, 5000);
function change()
{
    	if(!document.getElementById("ansehen"))
        {
    		document.getElementById("clubinfocard").innerHTML += "<div id='ansehen'></div>";
		}
    
        GM_xmlhttpRequest({
        method: "GET",
        url: "https://fussballcup.de/index.php?w=301&area=user&module=publicrelations&action=index#/index.php?w=301&area=user&module=publicrelations&action=index&_=*",
        headers: {"Content-Type": "application/x-www-form-urlencoded"},
         onload: function(responseDetails){
            var inhalt = responseDetails.responseText;
            var position = inhalt.indexOf('Fanansehen');
            var ansehen_site = inhalt.substr(position, 50);
            ansehen = ansehen_site.match(/[0-9]{1,10}/);
            if(ansehen >= 90 && ansehen < 98)
            {
             	ansehen = "<font color='yellow'>"+ String(ansehen) +"&#37;</font>";   
            }
            else if(ansehen < 90)
            {
                ansehen = "<font color='red'>"+ String(ansehen) +"&#37;</font>"; 
            }
            else
            {
                ansehen = String(ansehen) +"&#37;";
            }
            document.getElementById("ansehen").innerHTML = "<b style='font-size: 13px; margin-left: 6px'>Fanansehen: "+ String(ansehen) +"</b>";
        }	
      });
}