{"id":20417,"date":"2026-10-24T21:29:03","date_gmt":"2026-10-24T13:29:03","guid":{"rendered":"https:\/\/bruneiastronomy.org\/web\/?page_id=20417"},"modified":"2026-10-24T21:32:51","modified_gmt":"2026-10-24T13:32:51","slug":"past-alert","status":"publish","type":"page","link":"https:\/\/bruneiastronomy.org\/web\/past-alert\/","title":{"rendered":"Past Alerts"},"content":{"rendered":"\n<div id=\"astronomy-past-alert-page\">\n    Loading latest alert&#8230;\n<\/div>\n\n<script>\nasync function loadPageAlert() {\n    try {\n        const response = await fetch(\n            'https:\/\/bruneiastronomy.org\/alert.txt?v=' + Date.now()\n        );\n\n        if (!response.ok) {\n            throw new Error('Network response was not ok (Status: ' + response.status + ')');\n        }\n\n        const text = await response.text();\n\n        \/\/ Split the text by any variation of <br> (e.g., <br>, <br\/>, <br >)\n        const parts = text.split(\/<br\\s*\\\/?>\/i);\n        \n        let htmlContent = '';\n\n        parts.forEach(part => {\n            const trimmedPart = part.trim();\n            if (!trimmedPart) return; \/\/ Skip empty sections\n\n            const contentLower = trimmedPart.toLowerCase();\n\n            let bgColor = '#e8f5e9';     \/\/ Green (Default \/ No Alert)\n            let borderColor = '#4caf50';\n            let textColor = '#1b5e20';\n\n            if (contentLower.includes('status: urgent')) {\n                bgColor = '#f3e5f5';     \/\/ Purple\n                borderColor = '#9c27b0';\n                textColor = '#4a148c';\n            } else if (contentLower.includes('status: alert')) {\n                bgColor = '#ffebee';     \/\/ Red\n                borderColor = '#f44336';\n                textColor = '#b71c1c';\n            } else if (contentLower.includes('status: advisory')) {\n                bgColor = '#fff8e1';     \/\/ Yellow\n                borderColor = '#ffc107';\n                textColor = '#795548';\n            }\n\n            \/\/ Build a separate card for each section\n            htmlContent += \n                '<div style=\"' +\n                'background-color:' + bgColor + ';' +\n                'border-left:8px solid ' + borderColor + ';' +\n                'color:' + textColor + ';' +\n                'padding:20px;' +\n                'border-radius:10px;' +\n                'font-size:16px;' +\n                'line-height:1.7;' +\n                'white-space:pre-wrap;' +\n                'box-sizing:border-box;' +\n                'margin-bottom:15px;' +\n                '\">' +\n                trimmedPart +\n                '<\/div>';\n        });\n\n        if (!htmlContent) {\n            throw new Error('Alert text file was empty or improperly formatted.');\n        }\n\n        document.getElementById('astronomy-past-alert-page').innerHTML = htmlContent;\n\n    } catch (error) {\n        console.error(\"Error loading astronomy alert:\", error);\n\n        document.getElementById('astronomy-past-alert-page').innerHTML =\n            '<div style=\"' +\n            'background-color:#e8f5e9;' +\n            'border-left:8px solid #4caf50;' +\n            'color:#1b5e20;' +\n            'padding:20px;' +\n            'border-radius:10px;' +\n            'font-family:sans-serif;' +\n            '\">' +\n            '<strong>STATUS: NO ALERT<\/strong><br><br>' +\n            'There are currently no active astronomy alerts or the feed could not be reached.' +\n            '<\/div>';\n    }\n}\n\n\/* Initial load *\/\nloadPageAlert();\n\n\/* Refresh every 60 seconds *\/\nsetInterval(loadPageAlert, 60000);\n<\/script>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Loading latest alert&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_themeisle_gutenberg_block_has_review":false,"footnotes":""},"class_list":["post-20417","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/bruneiastronomy.org\/web\/wp-json\/wp\/v2\/pages\/20417","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bruneiastronomy.org\/web\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/bruneiastronomy.org\/web\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/bruneiastronomy.org\/web\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/bruneiastronomy.org\/web\/wp-json\/wp\/v2\/comments?post=20417"}],"version-history":[{"count":4,"href":"https:\/\/bruneiastronomy.org\/web\/wp-json\/wp\/v2\/pages\/20417\/revisions"}],"predecessor-version":[{"id":20421,"href":"https:\/\/bruneiastronomy.org\/web\/wp-json\/wp\/v2\/pages\/20417\/revisions\/20421"}],"wp:attachment":[{"href":"https:\/\/bruneiastronomy.org\/web\/wp-json\/wp\/v2\/media?parent=20417"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}