1export function myApi(name) {
2 return "hi " + name;
3}
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let arenaApiExample = (async () => {
4 const resp = await fetch(
5 "http://api.are.na/v2/channels/that-glassy-dark-design-style",
6 );
7 const json = await resp.json();
2
3export let runGET = fetchJSON(
4 `https://api.val.town/v1/run/stevekrouse.add?args=${JSON.stringify([1, 2])}`,
5);
4 testMutateSemantics({
5 stateName: "@stevekrouse.testState",
6 api: "localhost:3001",
7 mutateExpected: true,
8 mutator: (now) => `@steveVT.mutateTestState(${now})`,
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3export let spotifyAPI = ({token, endpoint, ...params}) => fetchJSON(
4 `https://api.spotify.com/v1/${endpoint}?${new URLSearchParams(params)}`,
5 {
6 headers: { Authorization: `Bearer ${token}` },
2
3export let runPOST = fetchJSON(
4 `https://api.val.town/v1/run/stevekrouse.add`,
5 {
6 method: "POST",
8 token: process.env.valtown,
9 error: true,
10 source: ["api", "interval", "email"],
11 since: interval.lastRunAt,
12 });
15 const llm = new ChatOpenAI({
16 modelName: "gpt-3.5-turbo",
17 openAIApiKey: process.env.OPENAI_API_KEY,
18 temperature: 0,
19 });
1export function myApi(name) {
2 return "hi " + name;
3}
1export function myApi(name) {
2 const random = Math.random(100);
3 return {