for airport in JFK GEO TXL SXF AGA LGW LTN SAW IKA KUL PER BKK KBP; do
curl "http://airportcode.riobard.com/airport/$airport?fmt=JSON";
echo;
sleep 1;
done
Semicolons are present because I did this in one line, left so you can too. Linebreaks are for HN convenience only. echo is because curl doesn't add linefeeds, sleep 1 is to be polite. $wc = New-Object "System.Net.WebClient"
$airports = @("JFK", "GEO", "TXL", "SXF", "AGA", "LGW", "LTN", "SAW", "IKA", "KUL", "PER", "BKK", "KBP")
foreach($airport in $airports) {
$wc.DownloadString("http://airportcode.riobard.com/airport/" + $airport + "?fmt=json")
}I haven't maintained that service for a long time, and I've got a dozen or so emails suggesting ways to improve the API. I'm not sure what I should do with it, given that the data is really scrapped from Wikipedia and pretty hard to keep it up-to-date. Any suggestions?
I was actually hoping to find just a data dump of them somewhere, but if you can't I suppose no such thing publicly exists.
My personal recommendation is to do what you want to do. If you don't want to maintain it, perhaps add a note about that, but whatever. You've got no obligation.
I was in searching of such a data dump before I wrote AirportCode, but like you said, it's not really available. Some websites sell these data for big fees, which I couldn't pay for, so I ended up scraping Wikipedia for the data. And these things change over the time, which makes it rather complicated to maintain.
I'm thinking maybe something like open source data would be helpful to make these kinds of data available to the public, and let the public to update and maintain it so everyone could benefit from it.