From b046f924120ba72701e2258404530e94c9c5a704 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 3 Sep 2026 05:59:20 +0000 Subject: [PATCH 1/3] Initial plan From 8f913c89b7460b0ef79c2ee4ba1129514c76460c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 3 Sep 2026 06:02:13 +0000 Subject: [PATCH 2/3] Update APOD URLs to new NASA domain Co-authored-by: oliveratgithub <280207+oliveratgithub@users.noreply.github.com> --- .env.example | 2 +- README.md | 2 +- public/includes/apod.inc.php | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.env.example b/.env.example index 9f0c1e7..83993fa 100644 --- a/.env.example +++ b/.env.example @@ -147,7 +147,7 @@ IPINFO_API_KEY="" # API can be queried without Token (but has lower rate limit) SPACEWEATHER_SOURCE="https://www.spaceweather.com/" NASA_API_KEY="DEMO_KEY" # API can be queried with the DEMO_KEY, but has rate limits NASA_APOD_API="https://api.nasa.gov/planetary/apod?api_key=${NASA_API_KEY}" -NASA_APOD_SOURCE="https://apod.nasa.gov/apod/" +NASA_APOD_SOURCE="https://science.nasa.gov/apod/" NASA_NEO_API="https://api.nasa.gov/neo/rest/v1/stats?api_key=${NASA_API_KEY}" NASA_DONKI_API_CME="https://api.nasa.gov/DONKI/CME?startDate=yyyy-MM-dd&endDate=yyyy-MM-dd&api_key=${NASA_API_KEY}" NASA_DONKI_API_CMEA="https://api.nasa.gov/DONKI/CMEAnalysis?startDate=2016-09-01&endDate=2016-09-30&mostAccurateOnly=true&speed=500&halfAngle=30&catalog=ALL&api_key=${NASA_API_KEY}" diff --git a/README.md b/README.md index fee311e..b7f4020 100644 --- a/README.md +++ b/README.md @@ -479,7 +479,7 @@ Die [NASA API](https://api.nasa.gov) wird benötigt um folgende Daten zu aggregi * Request: [https://api.nasa.gov/planetary/apod?api_key=DEMO_KEY] * Result ``` -{"date":"2020-04-18","explanation":"It was just another day on aerosol Earth. For August 23, 2018, the identification and distribution of aerosols in the Earth's atmosphere is shown in this dramatic, planet-wide digital visualization. Produced in real time, the Goddard Earth Observing System Forward Processing (GEOS FP) model relies on a combination of Earth-observing satellite and ground-based data to calculate the presence of types of aerosols, tiny solid particles and liquid droplets, as they circulate above the entire planet. This August 23rd model shows black carbon particles in red from combustion processes, like smoke from the fires in the United States and Canada, spreading across large stretches of North America and Africa. Sea salt aerosols are in blue, swirling above threatening typhoons near South Korea and Japan, and the hurricane looming near Hawaii. Dust shown in purple hues is blowing over African and Asian deserts. The location of cities and towns can be found from the concentrations of lights based on satellite image data of the Earth at night. Celebrate: Earth Day at Home","hdurl":"https://apod.nasa.gov/apod/image/2004/atmosphere_geo5_2018235_eq2400.jpg","media_type":"image","service_version":"v1","title":"Just Another Day on Aerosol Earth","url":"https://apod.nasa.gov/apod/image/2004/atmosphere_geo5_2018235_eq1200.jpg"} +{"date":"2020-04-18","explanation":"It was just another day on aerosol Earth. For August 23, 2018, the identification and distribution of aerosols in the Earth's atmosphere is shown in this dramatic, planet-wide digital visualization. Produced in real time, the Goddard Earth Observing System Forward Processing (GEOS FP) model relies on a combination of Earth-observing satellite and ground-based data to calculate the presence of types of aerosols, tiny solid particles and liquid droplets, as they circulate above the entire planet. This August 23rd model shows black carbon particles in red from combustion processes, like smoke from the fires in the United States and Canada, spreading across large stretches of North America and Africa. Sea salt aerosols are in blue, swirling above threatening typhoons near South Korea and Japan, and the hurricane looming near Hawaii. Dust shown in purple hues is blowing over African and Asian deserts. The location of cities and towns can be found from the concentrations of lights based on satellite image data of the Earth at night. Celebrate: Earth Day at Home","hdurl":"https://science.nasa.gov/apod/image/2004/atmosphere_geo5_2018235_eq2400.jpg","media_type":"image","service_version":"v1","title":"Just Another Day on Aerosol Earth","url":"https://science.nasa.gov/apod/image/2004/atmosphere_geo5_2018235_eq1200.jpg"} ``` ## Telegram Bot API diff --git a/public/includes/apod.inc.php b/public/includes/apod.inc.php index defa477..727c1a8 100644 --- a/public/includes/apod.inc.php +++ b/public/includes/apod.inc.php @@ -74,11 +74,11 @@ function get_apod($apod_date_input=NULL) * [copyright] => Francesco Sferlazza * [date] => 2018-08-01 * [explanation] => Cosmic rays from outer space go through your body every second. Typically, they do you no harm [...] - * [hdurl] => https://apod.nasa.gov/apod/http://nusoft.fnal.gov/nova/public/img/FD-evt-echo.gif + * [hdurl] => https://science.nasa.gov/apod/http://nusoft.fnal.gov/nova/public/img/FD-evt-echo.gif * [media_type] => image * [service_version] => v1 * [title] => Live: Cosmic Rays from Minnesota - * [url] => https://apod.nasa.gov/apod/http://nusoft.fnal.gov/nova/public/img/FD-evt-echo.gif + * [url] => https://science.nasa.gov/apod/http://nusoft.fnal.gov/nova/public/img/FD-evt-echo.gif * ) */ zorgDebugger::log()->debug('date("ymd",$apod_date_input): %s', [date('ymd',strtotime($apod_date_input))]); @@ -89,9 +89,9 @@ function get_apod($apod_date_input=NULL) $new_apod_explanation = (isset($apod_data['explanation']) ? $apod_data['explanation'] : 'The best APODs have no words at all - the image says it all.'); $new_apod_copyright = (isset($apod_data['copyright']) ? $apod_data['copyright'] : 'Uncredited'); $new_apod_mediatype = (isset($apod_data['media_type']) ? $apod_data['media_type'] : ''); - $new_apod_img_small = str_replace('https://apod.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', 'http', $apod_data['hdurl']); // with fix for malformed url (APOD API issue) - $new_apod_archive_url = APOD_SOURCE . 'ap'.$new_apod_date.'.html'; // E.g.: https://apod.nasa.gov/apod/ap180714.html + $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) + $new_apod_archive_url = APOD_SOURCE . 'ap'.$new_apod_date.'.html'; // E.g.: https://science.nasa.gov/apod/ap180714.html $new_apod_urlparts = pathinfo($new_apod_img_small); zorgDebugger::log()->debug('pathinfo(): %s', [print_r($new_apod_urlparts,true)]); $new_apod_fileext = $new_apod_urlparts['extension']; From 981d2be17d12b7d782d808d77cb284a0726f481b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 3 Sep 2026 06:48:25 +0000 Subject: [PATCH 3/3] Use APOD_SOURCE in URL normalization Co-authored-by: oliveratgithub <280207+oliveratgithub@users.noreply.github.com> --- public/includes/apod.inc.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/public/includes/apod.inc.php b/public/includes/apod.inc.php index 727c1a8..8da8c46 100644 --- a/public/includes/apod.inc.php +++ b/public/includes/apod.inc.php @@ -89,8 +89,9 @@ function get_apod($apod_date_input=NULL) $new_apod_explanation = (isset($apod_data['explanation']) ? $apod_data['explanation'] : 'The best APODs have no words at all - the image says it all.'); $new_apod_copyright = (isset($apod_data['copyright']) ? $apod_data['copyright'] : 'Uncredited'); $new_apod_mediatype = (isset($apod_data['media_type']) ? $apod_data['media_type'] : ''); - $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) + $apod_source_http_prefix = APOD_SOURCE . 'http'; + $new_apod_img_small = str_replace(['https://apod.nasa.gov/apod/http', $apod_source_http_prefix], 'http', $apod_data['url']); // with fix for malformed url (APOD API issue) + $new_apod_img_large = str_replace(['https://apod.nasa.gov/apod/http', $apod_source_http_prefix], 'http', $apod_data['hdurl']); // with fix for malformed url (APOD API issue) $new_apod_archive_url = APOD_SOURCE . 'ap'.$new_apod_date.'.html'; // E.g.: https://science.nasa.gov/apod/ap180714.html $new_apod_urlparts = pathinfo($new_apod_img_small); zorgDebugger::log()->debug('pathinfo(): %s', [print_r($new_apod_urlparts,true)]);