1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3/**
9 query: string;
10}): Promise<number[]> =>
11 fetchJSON("https://api.openai.com/v1/embeddings", {
12 method: "POST",
13 headers: {
29 <span>aasdfasdf</span>
30
31 <button onclick="fetchTest()">test</button>
32
33 Â Â
43${
44 raw(`
45 function fetchTest() {
46 console.log("hi");
47
48 fetch("https://api.val.town/v1/run/jonbo.fetchBcycleCounts")
49 .then((response) => {
50 if (!response.ok) {
1import { fetchText } from "https://esm.town/v/stevekrouse/fetchText";
2
3export let dateMeRSSText = fetchText(
4 "https://stevekrouse-dateMeRSS.express.val.run",
5);
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3// accessible via API at https://api.val.town/eval/@stevekrouse.basicAPIEx
4export const basicAPIEx = fetchJSON(
5 "https://date.nager.at/api/v2/publicholidays/2023/US"
6);
1import { fetch } from "https://esm.town/v/std/fetch";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
3
4export let hnTopStoryExecuted = (async () => {
5 const topStories: Number[] = await fetch(
6 "https://hacker-news.firebaseio.com/v0/topstories.json?print=pretty"
7 ).then((res) => res.json());
14 score: number;
15 by: string;
16 } = await fetchJSON(
17 `https://hacker-news.firebaseio.com/v0/item/${id}.json`
18 );
1import { fetchText } from "https://esm.town/v/stevekrouse/fetchText";
2let { valbeeTest } = await import("https://esm.town/v/stevekrouse/valbeeTest");
3
4export const valBeeExample = async () => {
5 return (valbeeTest = fetchText(
6 "http://numbersapi.com/random/math"
7 ));
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3// Returns NASA's Astronomy Picture of the Day (APOD)
4export const nasaAPOD = fetchJSON("cutt.ly/T7ksirK");
5// Forked from @iBrokeit.nasaAPOD
1import { fetchText } from "https://esm.town/v/stevekrouse/fetchText?v=5";
2
3// Random math fact
4export let mathFact = fetchText(
5 "http://numbersapi.com/random/math"
6);
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3// Github profile
4export let githubUser = fetchJSON(
5 "https://api.github.com/users/hultner"
6);
15 (c) => c.text("current state is" + currentState),
16 );
17 return app.fetch(req);
18};