APOD Viewer
Added the Astronomy Picture of the Day app, pulls straight from NASA’s API and shows today’s pic with the write-up tucked behind a toggle so the image gets to be the main object first.
-
Cached in
localStorageper calendar day, so reopening the window doesn’t burn another call for the same picture -
Nearly got got by this one: NASA sometimes serves a video instead of an image for the day, and my first pass just shoved the url into an
<img>tag, broken image icon staring back at me lol -
Added a
media_typecheck so videos link out instead of trying to embed -
Also handled the fetch failing outright, just shows a “try again later” message instead of leaving a blank window,
DEMO_KEY’s rate limit is gonna trip this eventually so it needed to fail gracefully lol
what’s next?
either stargazing conditions or the ISS tracker, we’ll see which one I go for
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.