Migrate APOD archive URLs to science.nasa.gov/apod with backward-compatible malformed URL normalization - #86
Draft
oliveratgithub with Copilot wants to merge 3 commits into
Draft
oliveratgithub with Copilot wants to merge 3 commits into
oliveratgithub with Copilot wants to merge 3 commits into
Conversation
Co-authored-by: oliveratgithub <280207+oliveratgithub@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update APOD website links for migration
Migrate APOD archive URLs to Sep 3, 2026
science.nasa.gov/apod with backward-compatible malformed URL normalization
oliveratgithub
requested changes
Sep 3, 2026
Comment on lines
+92
to
+93
| $new_apod_img_small = str_replace(['https://apod.nasa.gov/apod/http', 'https://science.nasa.gov/apod/http'], 'http', $apod_data['url']); // with fix for malformed url (APOD API issue) | ||
| $new_apod_img_large = str_replace(['https://apod.nasa.gov/apod/http', 'https://science.nasa.gov/apod/http'], 'http', $apod_data['hdurl']); // with fix for malformed url (APOD API issue) |
Contributor
There was a problem hiding this comment.
@copilot Use The dotENV VAR for the partial part, instead of continuing with a hardcoded full string.
Author
There was a problem hiding this comment.
Implemented in 981d2be: replaced the hardcoded new-domain prefix in the malformed APOD URL normalization with an APOD_SOURCE-derived prefix (APOD_SOURCE . 'http'), while keeping legacy apod.nasa.gov compatibility.
Co-authored-by: oliveratgithub <280207+oliveratgithub@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
APOD content links are moving from
apod.nasa.govtoscience.nasa.gov/apod, and existing URL construction/normalization paths needed updating to avoid broken archive/image links during the migration window. This change updates the base source URL and keeps malformed API URL handling compatible with both old and new APOD host patterns.Configuration
NASA_APOD_SOURCEin.env.exampletohttps://science.nasa.gov/apod/.APOD_SOURCEconstant usage remains unchanged and now resolves to the new domain via env config.Runtime APOD URL handling
public/includes/apod.inc.phpto accept both legacy and new APOD prefixes before collapsing to the underlyinghttp...target URL.Documentation/examples
README.mdand inline APOD response comments to the new domain.