Read the statement by Michael Teeuw here.
Can anyone revive AviationWX, PilotWX, or TAF
-
@sdetweil If you want to use fetch you can do the first call as follows.
try { const response = await fetch(metarUrl, { headers: { 'Accept-Encoding': 'gzip', // Request gzip compression }, }); if (!response.ok) { throw new Error(`HTTP error! Status: ${response.status}`); } // Read response body as buffer const buffer = await response.buffer(); // Manually decompress gzip data const zlib = require('zlib'); const decompressedData = zlib.gunzipSync(buffer).toString();You could use pako.
const decompressedData = pako.inflate(buffer, { to: 'string' }); -
@mumblebaj but… you are not supposed to have to do either
-
@sdetweil I have not seen another way. Sorry…:man_facepalming:
-
@mumblebaj @sdetweil fwiw, and I don’t know if this would be any easier for the situation.
There is a site called avwx.rest
(I believe the pilot wx all was using that source)It’s an API built solely for pilot data
You do need a key but maybe the data will be easier to pull? -
@FSAHD I might use that for pilot.
we are just talking about using more current support , so the module lasts longer
-
@sdetweil There is a simple api call from the site to get the metar data whicg might be simpler to use.
-
thanks to your help I fixed the code to use the airport specific request which returns json and not gzip…
@FSAHD the output changed metar output changed again… sorry
i updated the sample text againso git pull, and npm install
-
@sdetweil No worries. I really appreciate both of you alls help. Ill spend as much time I need on my end to get it up and going!
@mumblebaj thanks for adding your .02 cents to help this move forward.
Im new to this MM forum so I am not sure how to go about this but I would love to either get you both a cup of coffee or just donate to your efforts as a thank you!
-
@FSAHD I don’t accept donations.
I do this for fun and learning, so I’m already rewarded. -
@FSAHD No donations required. We love this project and this forum. :winking_face:
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login