1
2
3
4
5
6
7
8
9
10
11
12
13
import { fetch } from "https://esm.town/v/std/fetch";
export async function getSofZmanShma(city) {
console.log({ city });
const today = new Date().toISOString().split("T")[0];
const data = await (
await fetch(
`https://www.hebcal.com/zmanim?cfg=json&city=${city}&date=${today}`
)
).json();
console.log(data.times.sofZemanShma);
return data.times.sofZemanShma;
}
👆 This is a val. Vals are TypeScript snippets of code, written in the browser and run on our servers. Create scheduled functions, email yourself, and persist small pieces of data — all from the browser.