Last active
February 7, 2020 19:23
-
-
Save jaredchu/9a8eb04140f6fce79a42f8a384355d72 to your computer and use it in GitHub Desktop.
Vultr get list of location data from https://www.vultr.com/resources/faq/#downloadspeedtests
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
var results = []; | |
$('#speedtest_v4 tr').each(function (){ | |
var i = 0; | |
var name; | |
var ip; | |
var link100; | |
var link1000; | |
$(this).find('td').each(function (){ | |
switch(i) { | |
case 0: | |
name = $(this).text().trim(); | |
break; | |
case 1: | |
ip = $(this).text().trim(); | |
break; | |
case 2: | |
link100 = $(this).find('a:first-child').attr('href'); | |
link1000 = $(this).find('a:last-child').attr('href'); | |
} | |
i++; | |
}); | |
results.push({ | |
name: name, | |
ip: ip, | |
link100: link100, | |
link1000: link1000 | |
}); | |
}); | |
// print the array value on Google Chrome Console | |
// console.log(JSON.stringify(results)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment