Free IATA + ICAO airport codes database

Parsed from: Wikipedia.

Available on YAML or JSON format.

Data example:

- :airport_name: Charles de Gaulle International Airport (Roissy Airport)
  :complete_location: Paris, France
  :city: Paris
  :country: "France"
  :iata_code: CDG
  :icao_code: LFPG

Continue reading

Phone calling codes (aka International Dialing codes) – DB Dump / YML format

Parsed from: http://en.wikipedia.org/wiki/List_of_country_calling_codes with Hpricot:

doc = Hpricot(open("http://en.wikipedia.org/wiki/List_of_country_calling_codes"))
table = (doc/"table")[4]
by_country = {}
table.search('/tr').each {|tr| tr0 = tr.search('/td')[0] ; tr1 = tr.search('/td')[1]; by_country[tr0.inner_html.gsub(/<.*>/,  "")] = tr1.search('/a').inner_html.gsub(" ", '').split(/\+/).select{|val| !val.empty?}.map(&:to_i) if tr1  } ; nil

Phone calling codes (MySQL dump)

Phone calling codes by country (YML format)