1import { fetch } from "https://esm.town/v/std/fetch";
2import { query } from "https://esm.town/v/neverstew/query";
3
4export const queryExample = fetch("https://jsonplaceholder.typicode.com/todos")
5 .then((r) => r.json())
6 .then((data) =>
1import { fetch } from "https://esm.town/v/std/fetch";
2import { turso as turso2 } from "https://esm.town/v/neverstew/turso";
3import { createMigration } from "https://esm.town/v/neverstew/createMigration";
55 version.code,
56 );
57 await fetch(`https://val.town/v1/eval/${innerFn}`, {
58 headers: {
59 Authorization: `Bearer ${token}`,
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function SearchValTown(query: string) {
8 encodeURIComponent(input)
9 }`;
10 const res = await fetch(searchURL);
11 const payload = await res.json();
12 return payload.result.data;
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 { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3/**
5 Receive daily emails of reported congress trades by scheduling a call to
6
7 @claytn.fetchCongressTradeReports((reports) => console.email(reports))
8*/
9
10
11export async function fetchCongressTradeReports(callback) {
12 const res = await fetchJSON(
13 "https://bff.capitoltrades.com/trades?sortBy=-pubDate"
14 );
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let sendNotification = async (params: { channel: string, message: string }) => {
9
10 try {
11 const response = await fetch(`https://ntfy.sh/${channel}`, {
12 method: "POST",
13 body: message,
3import { dateCalendarKey } from "https://esm.town/v/tal/dateCalendarKey";
4import { parseMenuLine } from "https://esm.town/v/tal/parseMenuLine";
5import { fetchDOEMenu } from "https://esm.town/v/tal/fetchDOEMenu";
6
7export async function fetchAndStore(opts: {
8 schoolYear: `${number}-${number}`;
9 month: string;
10 menuType: string;
11}) {
12 const menuText = await fetchDOEMenu(opts);
13 const lines: ReturnType<typeof parseMenuLine>[] = await Promise
14 .all(menuText.split("\r\n").map(parseMenuLine));
15 const key = dateCalendarKey(opts);
16 doeMenuResponseStore[key] = {
17 lastFetchedAt: new Date(),
18 lines,
19 };
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function communityBoatingFlag() {
4 const response = await fetch("https://api.community-boating.org/api/flag");
5 const text = await response.text();
6 // Regex by Chat GPT :shrug:
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function emailDailyJoke() {
4 async function fetchJoke() {
5 let response = await fetch(
6 "https://official-joke-api.appspot.com/random_joke",
7 );
10 }
11 }
12 const randomJoke = await fetchJoke();
13 const setup = randomJoke.setup;
14 const punchline = randomJoke.punchline;
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export let openAiTextCompletion = async (params: {
33 args.stream = false;
34
35 const response = await fetchJSON("https://api.openai.com/v1/completions", {
36 method: "POST",
37 headers: {