Skip to content

Commit

Permalink
Fix for aviationweather URL
Browse files Browse the repository at this point in the history
  • Loading branch information
joergschultzelutter committed Mar 3, 2024
1 parent 57a5512 commit 8d387d0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ aprslib>=0.6.47
beautifulsoup4>=4.9.3
expiringdict>=1.2.1
geopy>=2.2.0
iso3166>==1.0.1
iso3166>=1.0.1
maidenhead>=1.6.0
requests>=2.26.0
skyfield>=1.39
Expand Down
9 changes: 4 additions & 5 deletions src/airport_data_modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import logging
from utility_modules import check_if_file_exists, build_full_pathname


# icao https://www.aviationweather.gov/docs/metar/stations.txt

logging.basicConfig(
Expand Down Expand Up @@ -159,9 +158,9 @@ def get_metar_data(icao_code: str):
try:
resp = requests.get(
f"https://www.aviationweather.gov/"
f"adds/metars/?station_ids={icao_code}"
f"&std_trans=standard&chk_metars=on"
f"&hoursStr=most+recent+only&submitmet=Submit"
f"cgi-bin/data/metar.php/?ids={icao_code}"
f"&hours=0&order=id%2C-obs&sep=true"
f"&taf=true"
)
except requests.exceptions.RequestException as e:
logger.error(msg="{e}")
Expand Down Expand Up @@ -382,7 +381,7 @@ def get_nearest_icao(latitude: float, longitude: float):


if __name__ == "__main__":
logger.info(get_metar_data("EDDF"))
logger.info(get_metar_data("EDDL"))
logger.info(validate_iata("KLV"))
logger.info(validate_icao("EDDF"))
logger.info(get_nearest_icao(51.538882, 8.32679))
2 changes: 1 addition & 1 deletion src/mpad_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#
# Program version
#
mpad_version: str = "0.40"
mpad_version: str = "0.41"
#
###########################
# Constants, do not change#
Expand Down

0 comments on commit 8d387d0

Please sign in to comment.