Fanansehen

Zeigt das Fanansehen auf der Fussballcup-Startseite an.

目前為 2018-05-27 提交的版本,檢視 最新版本

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