aboutsummaryrefslogtreecommitdiffstats
path: root/src/data.ts
diff options
context:
space:
mode:
authorMaksymilian Jopek <maks@jopek.eu>2023-11-15 19:29:24 +0100
committerMaksymilian Jopek <maks@jopek.eu>2023-11-15 19:34:12 +0100
commit857c528369473a66518407dee6f6cac89bbc538c (patch)
treecccf02a369ee6cafb2a89750ee222ebba69d2269 /src/data.ts
downloadlisteya-xelata-nobele-857c528369473a66518407dee6f6cac89bbc538c.tar.gz
listeya-xelata-nobele-857c528369473a66518407dee6f6cac89bbc538c.tar.zst
listeya-xelata-nobele-857c528369473a66518407dee6f6cac89bbc538c.zip
Initial commit, v1.0.0HEADmaster
Diffstat (limited to 'src/data.ts')
-rw-r--r--src/data.ts16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/data.ts b/src/data.ts
new file mode 100644
index 0000000..116308d
--- /dev/null
+++ b/src/data.ts
@@ -0,0 +1,16 @@
+export let nobelPrizes: NobelPrize[] = [];
+export async function setNobelPrizes() {
+ nobelPrizes = (
+ await fetch("https://api.nobelprize.org/2.1/nobelPrizes").then((res) =>
+ res.json(),
+ )
+ ).nobelPrizes;
+}
+
+export interface NobelPrize {
+ awardYear: string;
+ category: { en: string; no: string; se: string };
+ dateAwarded: string;
+ prizeAmount: number;
+ prizeAmountAdjusted: number;
+}