dferrante / pywx

python weather bot
10 stars 3 forks source link

Fall back on airports.db if Google API call fails #18

Open dziban303 opened 6 years ago

dziban303 commented 6 years ago

tsia. since the location function is broken most of the time, have a function to lookup ICAO code for a given airport. Could search airports.db.

Presently, if there's an error when accessing Google's API, the bot returns "Location not found." Instead, it should check to see if the location's name is already present in airports.db, and use those coördinates for the forecast lookup.

E.g., user calls for forecast at Des Moines, wx des moines, but Google API call fails, so then search airports.db for des moines, finding 3729,"Des Moines Intl","Des Moines","United States","DSM","KDSM",41.533972,-93.663083,958,-6,"A" and passing those coörds on to forecast.io.