2018-12-26::ANAの機内WiFiポータルを覗き見る

ちょっと仕事で札幌に行く用事。ANA 機内WiFiなるものが気になったので使ってたのだが、ポータルサイトの通信が異常に多いことに気が付いてDev Consoleで見てみたら、何やら楽しそうなJSONがやりとりされてたのでGETしてみた。

curl "http://services.inflightpanasonic.aero/inflight/services/flightdata/v1/flightdata" | jq .
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  2151  100  2151    0     0   181k      0 --:--:-- --:--:-- --:--:--  190k
{
  "td_id_decompression": "0",
  "td_id_weight_on_wheels": "0",
  "td_id_all_doors_closed": "1",
  "td_id_x2_pa_state": "0",
  "td_id_fltdata_ground_speed": "0433",
  "td_id_fltdata_time_to_destination": "0051",
  "td_id_fltdata_wind_speed": "-140",
  "td_id_fltdata_mach": "0836",
  "td_id_fltdata_true_heading": "0191",
  "td_id_fltdata_gmt": "0419",
  "td_id_fltdata_outside_air_temp": "8050",
  "td_id_fltdata_head_wind_speed": "-140",
  "td_id_fltdata_date": "00261218",
  "td_id_fltdata_distance_to_destination": "00000287",
  "td_id_fltdata_altitude": "00032001",
  "td_id_fltdata_present_position_latitude": "00039352",
  "td_id_fltdata_present_position_longitude": "00141077",
  "td_id_fltdata_destination_latitude": "00035339",
  "td_id_fltdata_destination_longitude": "00139455",
  "td_id_fltdata_destination_id": "RJTT",
  "td_id_fltdata_departure_id": "RJCC",
  "td_id_fltdata_flight_number": "ANA62",
  "td_id_fltdata_destination_baggage_id": "HND",
  "td_id_fltdata_departure_baggage_id": "CTS",
  "td_id_airframe_tail_number": "JA707A",
  "td_id_flight_phase": "7",
  "td_id_gmt_offset_departure": "00009.00",
  "td_id_gmt_offset_destination": "00009.00",
  "td_id_route_id": "2",
  "td_id_fltdata_time_at_origin": "1319",
  "td_id_fltdata_time_at_destination": "1319",
  "td_id_fltdata_distance_from_origin": "00000196",
  "td_id_fltdata_distance_traveled": "00000196",
  "td_id_fltdata_estimated_arrival_time": "1410",
  "td_id_fltdata_time_at_takeoff": "002612180348",
  "td_id_fltdata_departure_latitude": "00042463",
  "td_id_fltdata_departure_longitude": "00141413",
  "td_id_pdi_fltdata_departure_iata": "",
  "td_id_pdi_fltdata_departure_time_scheduled": "",
  "td_id_pdi_fltdata_arrival_iata": "",
  "td_id_fltdata_wind_direction": "0268",
  "td_id_media_date": "20181201",
  "td_id_extv_channel_listing_version": "1075",
  "disclaimer": "Attn: Data elements such as temperature, flight latitude, flight longitude, etc. are classified as Product Public under the Panasonic Product Data Classification Framework. Information under this classification does not carry any access, labeling, or transmission restrictions. Deliberate or accidental exposure to these types of data elements, does not lead to any adverse impact to aircraft operations or safety."
}

暇なんでGoogle Mapsで現在位置URL生成するスクリプト書いてみた。

In [12]:
import requests
import json

url = "http://services.inflightpanasonic.aero/inflight/services/flightdata/v1/flightdata"
headers = {"content-type": "application/json"}
r = requests.get(url, headers=headers)
d = r.json()
lat = float(d["td_id_fltdata_present_position_latitude"]) / 1000
lon = float(d["td_id_fltdata_present_position_longitude"]) / 1000
print(f"https://maps.google.com/maps?z=10&q={lat},{lon}")
https://maps.google.com/maps?z=10&q=36.156,140.148

うむ、動いた。もう少し時間あれば定期的にGETしてきてピン動かすとかしたかったんだけど、そろそろ降下なのでここまで、ちゃんちゃん。

機内サーバーに地図データ置いてリアルタイムにみられるようにすればいいと思うんだがいかんのかね・・・(飛んでる時に現在地が常に知りたい病)

Share