Created
August 26, 2018 12:07
-
-
Save bkralik/c42ea69a634b86badeb9e13642bd02de to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==UserScript== | |
| // @name UserDB pinger | |
| // @version 1 | |
| // @match http://userdb.hkfree.org/* | |
| // @match https://userdb.hkfree.org/* | |
| // @grant GM.xmlHttpRequest | |
| // @run-at document-idle | |
| // @require http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js | |
| // ==/UserScript== | |
| $(".grid-cell-IPAdresa span").each(function(index) { | |
| ips = $( this ).attr('title'); | |
| if(ips) { | |
| ips = ips.replace(/ /g, ""); | |
| GM.xmlHttpRequest({ | |
| method: "GET", | |
| url: "http://sojka.hkfree.org/pinger/?rq=ping&ips="+ips, | |
| onload: function(response) { | |
| f = parseFloat(response.responseText); | |
| if(f > 0.95) { | |
| $(this).css("background-color", "green"); | |
| } else if(f > 0.1) { | |
| $(this).css("background-color", "yellow"); | |
| } else { | |
| $(this).css("background-color", "red"); | |
| } | |
| }.bind(this) | |
| }); | |
| } | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment