Skip to content

Instantly share code, notes, and snippets.

@jaredchu
Last active February 7, 2020 19:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jaredchu/9a8eb04140f6fce79a42f8a384355d72 to your computer and use it in GitHub Desktop.
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
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