Created
November 30, 2010 13:31
-
-
Save dirceu/721675 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
// 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