def fetch_aviationweather_taf(icao): r = http.request('GET', (AVIATIONWEATHER_TAF_URL % icao)) d = ElementTree.fromstring((r.data.decode('utf-8'))) if not d.find('data').find("TAF").find("raw_text").text: return None taf = d.find('data').find("TAF").find("raw_text").text return taf
def fetch_faa_atis(icao): r = http.request('GET', 'https://datis.clowd.io/api/' + icao) d = json.loads(r.data.decode('utf-8')) if 'error' in d: return None atis = {} for a in d: if a['type'] == 'arr': atis['arr'] = a['datis'] elif a['type'] == 'dep': atis['dep'] = a['datis'] else: atis['combined'] = a['datis'] return atis
def fetch_pilotedge_atis(icao): r = http.request('GET', 'https://www.pilotedge.net/atis/' + icao + '.json') if len(r.data) < 3: return None d = json.loads(r.data.decode('utf-8')) return {"combined": d['text'].replace('\n\n', ' ')}
def fetch_vatsim(icao): r = http.request('GET', 'http://metar.vatsim.net/metar.php?id=' + icao) return r.data
def fetch_pilotedge(icao): r = http.request('GET', 'https://www.pilotedge.net/atis/' + icao + '.json') if len(r.data) < 3: return None d = json.loads(r.data.decode('utf-8')) return d['metar']
def fetch_ivao_whazzup_blob(): r = http.request('GET', 'https://api.ivao.aero/getdata/whazzup/whazzup.txt') return r.data.decode("ISO-8859-1").splitlines()
def fetch_ivao_taf_blob(): r = http.request('GET', IVAO_TAF_URL) return r.data.decode("ISO-8859-1").splitlines()
def fetch_ivao_metar_blob(): r = http.request('GET', 'http://wx.ivao.aero/metar.php') return r.data.decode("utf-8").splitlines()
def fetch_vatsim_blob(): r = http.request('GET', 'http://cluster.data.vatsim.net/vatsim-data.json') return json.loads(r.data.decode('utf-8'))
def fetch_ms_blob(): r = http.request( 'GET', 'https://fsxweatherstorage.blob.core.windows.net/fsxweather/metars.bin' ) return r.data.decode("utf-8").splitlines()