Skip to content

Instantly share code, notes, and snippets.

@dirceu
Created November 30, 2010 13:31
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 dirceu/721675 to your computer and use it in GitHub Desktop.
Save dirceu/721675 to your computer and use it in GitHub Desktop.
// Imported from http://www.nationsonline.org/oneworld/IATA_Codes/airport_code_list.htm
// Use the "jQuerify" extension for Google Chrome and run the following script on the JavaScript Console
var airports = [];
$.each($('tr[bgcolor=#EEEEEE]'), function(idx, el) {
airports.push('INSERT INTO `ean_airports` (`city`, `country`) VALUES ("'+$('td', el)[0].textContent.trim()+' ('+$('td', el)[2].textContent.trim()+')", "'+$('td', el)[1].textContent.trim()+'");');
});
airports.sort();
airports.join('\n');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment