32 lines
808 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'
2023-06-15 18:19:23 +01:00
import Nav from '$lib/navigation/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}`)
2023-06-15 18:19:23 +01:00
document.getElementById('data_raw').textContent = await data.text();
2023-06-13 13:38:59 +01:00
})
</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 />