<script>
   import Menu from '../../components/header.svelte'
   import Footer from '../../components/footer.svelte'
   
   import {onMount} from 'svelte'

   const title = "Public Board"
   const page = "ldb"

   async function getHeadcode() {
        return new URLSearchParams(window.location.search).get('station');
    }

    onMount(async () => {
        const station = await getHeadcode();
        document.getElementById('station').textContent = station;
        const data = await fetch(`https://owlboard.info/api/v1/ldb/${station}`)
        document.getElementById('data_raw').textContent = JSON.stringify(await data.json());
    })

</script>

<Menu {title} />

<p>Station: <span id="station"></span></p>
<p id="data_raw"></p>


<Footer {page} />