feat: Fetch and parse METARs from metars.txt into memory

Co-authored-by: aider (gemini/gemini-2.5-pro) <aider@aider.chat>
This commit is contained in:
2026-02-14 14:29:04 -07:00
parent 806d4f04f7
commit f861b3cecd
+16 -3
View File
@@ -14,10 +14,23 @@
</div>
<script>
const metars = [];
fetch('metars.txt')
.then(response => response.text())
.then(data => {
const lines = data.split('\n');
lines.forEach(line => {
if (line.includes('METAR')) {
const metarString = line.substring(line.indexOf('METAR') + 6).replace('=', '').trim();
if (metarString) {
metars.push(metarString);
}
}
});
console.log(`Loaded ${metars.length} METARs.`);
})
.catch(error => console.error('Error fetching or parsing metars.txt:', error));
</script>
</body>
</html>