Fanansehen

Zeigt das Fanansehen auf der Fussballcup-Startseite an.

目前为 2018-05-26 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Fanansehen
  3. // @include https://fussballcup.de/*
  4. // @version 0.1.4
  5. // @description Zeigt das Fanansehen auf der Fussballcup-Startseite an.
  6. // @copyright Klaid, 2013 - edited by mot33, 2018
  7. // @grant GM_xmlhttpRequest
  8. // @namespace https://greasyfork.org/users/83290
  9. // ==/UserScript==
  10. window.setTimeout(function() { change(); }, 2500);
  11. window.setInterval(function() { change(); }, 5000);
  12. function change()
  13. {
  14. if(!document.getElementById("ansehen"))
  15. {
  16. document.getElementById("clubinfocard").innerHTML += "<div id='ansehen'></div>";
  17. }
  18. GM_xmlhttpRequest({
  19. method: "GET",
  20. url: "http://fussballcup.de/index.php?w=301&area=user&module=publicrelations&action=index#/index.php?w=301&area=user&module=publicrelations&action=index&_=*",
  21. headers: {"Content-Type": "application/x-www-form-urlencoded"},
  22. onload: function(responseDetails){
  23. var inhalt = responseDetails.responseText;
  24. var position = inhalt.indexOf('Fanansehen');
  25. var ansehen_site = inhalt.substr(position, 50);
  26. ansehen = ansehen_site.match(/[0-9]{1,10}/);
  27. if(ansehen >= 90 && ansehen < 98)
  28. {
  29. ansehen = "<font color='yellow'>"+ String(ansehen) +"&#37;</font>";
  30. }
  31. else if(ansehen < 90)
  32. {
  33. ansehen = "<font color='red'>"+ String(ansehen) +"&#37;</font>";
  34. }
  35. else
  36. {
  37. ansehen = String(ansehen) +"&#37;";
  38. }
  39. document.getElementById("ansehen").innerHTML = "<b style='font-size: 13px; margin-left: 6px'>Fanansehen: "+ String(ansehen) +"</b>";
  40. }
  41. });
  42. }