You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Apologies for not seeing this and responding earlier, @ooohfascinating ! Apparently I don't have notifications enabled on my Github.
The primary reason for API choice is that the aviationweather.gov source randomly changes with no notice to users. (In 10 years of trying to use it for random small projects like this, it's changed/broken at least 20 times). Additionally, and the primary benefit, is avwx.rest can get international airports. The .gov source may be able to get intl, nowadays, but I just tend to not trust it long-term and don't want to be messing with code on fun little projects like this all the time!
Why not use, https://aviationweather.gov/cgi-bin/data/metar.php?ids=${AirPortlocation}&format=json
Free api for METARS no need for a api key
this is possible with a slight change to the Update method:
update() {
Log.info(this.data.name + ": Fetching new METARs (" + this.config.airports.join(", ") + ")")
this.config.airports.forEach((airport)=> {
var updated = false;
Log.info(this.data.name + ": Fetching " + airport)
this.fetchData(
https://aviationweather.gov/cgi-bin/data/metar.php?ids=${airport}&format=json
).then((data) => {
and the fetchData Method:
async fetchData(url) {
return performWebRequest(url,type = "json",true);
}
Feel free to tell me off, just curious
The text was updated successfully, but these errors were encountered: