]> OzVa Git service - spaceweather/commitdiff
init
authorwill <greenwoodw50@gmail.com>
Sat, 30 Mar 2024 22:56:24 +0000 (22:56 +0000)
committerwill <greenwoodw50@gmail.com>
Sat, 30 Mar 2024 22:56:24 +0000 (22:56 +0000)
spaceweather.html [new file with mode: 0755]
stars.jpg [new file with mode: 0755]

diff --git a/spaceweather.html b/spaceweather.html
new file mode 100755 (executable)
index 0000000..0628b31
--- /dev/null
@@ -0,0 +1,67 @@
+<!DOCTYPE html>
+<html>
+  <head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>Space Weather</title>
+    <link rel="icon" type="image/ico" href="/favicon.ico">
+    
+    <style>
+    
+    body {
+     color: white;
+     padding: 20px;
+     background-image: url(stars.jpg);
+    }
+    
+    p {
+     background-color: black;
+     padding: 10px;
+    }
+    
+    </style>
+  
+    <script>
+      async function puttext () {
+        fetch("https://services.swpc.noaa.gov/text/discussion.txt")
+          .then(response => response.text())
+          .then(result => result.replaceAll(/ NE /g, " north east "))
+          .then(result => result.replaceAll(/ SE /g, " south east "))
+          .then(result => result.replaceAll(/ SW /g, " south west "))
+          .then(result => result.replaceAll(/ NW /g, " north west "))
+          .then(result => result.replaceAll(/nT/g, "nano tesla"))
+          .then(result => result.replaceAll(/UTC/g, "utc"))
+          .then(result => result.replaceAll(/\/Sf/g, " solar flux"))
+          .then(result => result.replaceAll(/MeV/g, "mega electron volt"))
+          .then(result => result.replaceAll(/CME/g, "coronal mass ejection"))
+          .then(result => result.replaceAll(/km\/s/g, "kilometers per second"))
+          .then(result => result.replaceAll(/.24 hr Summary...\n/g, "In the last 24 hours "))
+          .then(result => result.replaceAll(/CH HSS/g, "coronal hole high speed stream"))
+          .then(result => result.replaceAll(/(\s*\(.*?\)\s*)|(\n\.Forecast\.\.\.\n)/g, " "))
+          .then(result => result.replaceAll(/(?![ 0-9])\-(?=[ 0-9])/g, " to "))
+          .then(result => result.replaceAll(/\n[A-z]+( [A-z]+)?\n/g, "\n"))
+          .then(result => result.replaceAll(/(.|\n)+#/g, ""))
+          .then(result => result.replaceAll(/\.(?=\S)/g, ". "))
+          .then(result => result.replaceAll(/,(?=\S)/g, ", "))
+          .then(result => result.replaceAll(/(\n)+/g, ""))
+          .then(result => "Welcome to Space weather. Issued by XMDV Radio on behalf of Utter. " + result + " This has been Space weather. Created by William Greenwood and supported by the NOAA.")
+          .then(result => document.getElementById("body").innerHTML = result);
+      }
+      
+      puttext()
+    </script>
+  </head>
+  
+  <body>
+  
+    <p><a href="./index.html">&lt;-- XMDV Radio homepage</a></p>
+  
+    <h1>Space Weather</h1>
+    
+    <p><a href="http://xmdvradio.duckdns.org:8080/spaceweather.mp3">Listen - automatically generated everyday</a></p>
+    
+    <p id=body><em>Generating... Requires javascript</em></p>
+    
+    <p><a href="https://services.swpc.noaa.gov/text/discussion.txt">Data source: NOAA</a></p>
+  </body>
+</html>
diff --git a/stars.jpg b/stars.jpg
new file mode 100755 (executable)
index 0000000..42f65c3
Binary files /dev/null and b/stars.jpg differ