Public
RPC
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import { fetch } from "https://esm.town/v/std/fetch";
export async function myApi() {
const url =
"https://everycampus.com/campus/c1e6333f-7f5b-475d-897a-c78e0a88135e";
try {
const response = await fetch(url, {
method: "GET",
headers: {
"Content-Type": "application/json",
"Accept": "application/json",
},
});
const responseJson = await response.json();
const number_completed =
responseJson.campus.completed_walker_prayer_walks_count;
return "Completed prayer walks at USF: " + number_completed;
}
catch (error) {
console.error("Error fetching data:", error);
throw error;
}
}
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Comments
Nobody has commented on this val yet: be the first!
October 23, 2023