32 lines
789 B
Svelte
Raw Normal View History

2023-06-13 13:38:59 +01:00
<script>
2023-06-14 11:02:46 +01:00
import Header from '$lib/header.svelte'
import Nav from '$lib/nav.svelte'
2023-06-13 13:38:59 +01:00
import { onMount } from 'svelte'
const title = "Timetable Results"
async function getHeadcode() {
return new URLSearchParams(window.location.search).get('headcode');
}
onMount(async () => {
const headcode = await getHeadcode();
document.getElementById('headcode').textContent = headcode;
const data = await fetch(`https://owlboard.info/api/v1/train/headcode/today/${headcode}`)
document.getElementById('data_raw').textContent = data.text;
})
</script>
<svelte:head>
<title>OwlBoard {title}</title>
</svelte:head>
2023-06-14 11:02:46 +01:00
<Header {title} />
2023-06-13 13:38:59 +01:00
<p>Headcode: <span id="headcode"></span></p>
<p id="data_raw"></p>
2023-06-14 11:02:46 +01:00
<Nav />