-
-
Save nightlyworker/d3c064dda4fc7fa709d7 to your computer and use it in GitHub Desktop.
This file contains 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
<html> | |
<head> | |
<script> | |
var locations = { | |
"speedtestwe": "West Europe", | |
"speedtestsea" : "Southeast Asia", | |
"speedtestea": "East Asia", | |
"speedtestnsus": "North Central US", | |
"speedtestne": "North Europe", | |
"speedtestscus": "South Central US", | |
"speedtestwus": "West US", | |
"speedtesteus": "East US", | |
"speedtestjpe": "Japan East", | |
"speedtestjpw": "Japan West" | |
}; | |
var i = 1; | |
// This function is called when each Data Center responds. | |
// The first to respond is the nearest! | |
function call(name){ | |
console.log(i + ":" + locations[name]); | |
i++; | |
} | |
for(var name in locations){ | |
append(name); | |
} | |
function append(name){ | |
var head = document.getElementsByTagName("head")[0]; | |
var newscrpt; | |
newscrpt = document.createElement('script'); | |
newscrpt.type = "text/javascript" ; | |
newscrpt.src = "//" + name + ".blob.core.windows.net/cb.json"; | |
newscrpt = head.appendChild(newscrpt); | |
} | |
</script> | |
</head> | |
<body>Results are in the console</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment