Changeset 1114:177cccfbb71c for src/mlx


Ignore:
Timestamp:
10/18/23 17:27:35 (13 months ago)
Author:
István Váradi <ivaradi@…>
Branch:
python3
Phase:
public
Message:

Updated METAR download for the new API

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mlx/web.py

    r1074 r1114  
    654654    def run(self):
    655655        """Perform the retrieval opf the METARs."""
    656         url = "http://www.aviationweather.gov/adds/dataserver_current/httpparam?"
    657         data = urllib.parse.urlencode([ ("dataSource" , "metars"),
    658                                   ("requestType",  "retrieve"),
    659                                   ("format", "csv"),
    660                                   ("stationString", " ".join(self._airports)),
    661                                   ("hoursBeforeNow", "24"),
    662                                   ("mostRecentForEachStation", "constraint")])
     656        url = "https://aviationweather.gov/cgi-bin/data/metar.php?"
     657        data = urllib.parse.urlencode([ ("ids", ",".join(self._airports)),
     658                                        ("hours", "0"),
     659                                        ("format", "raw") ])
    663660        result = Result()
    664661        result.metars = {}
Note: See TracChangeset for help on using the changeset viewer.